Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 333194 Details for
Bug 448362
net-misc/spice-gtk - after having been full screen, spicy changes DPI in X
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to keep current DPI instead of forcing 96 when exit from full screen
0.14-keep-dpi.patch (text/plain), 1.96 KB, created by
Alex Efros
on 2012-12-24 11:49:10 UTC
(
hide
)
Description:
patch to keep current DPI instead of forcing 96 when exit from full screen
Filename:
MIME Type:
Creator:
Alex Efros
Created:
2012-12-24 11:49:10 UTC
Size:
1.96 KB
patch
obsolete
>diff -uNr spice-gtk-0.14.orig/gtk/display/gnome-rr-config.c spice-gtk-0.14/gtk/display/gnome-rr-config.c >--- spice-gtk-0.14.orig/gtk/display/gnome-rr-config.c 2012-01-18 12:24:34.000000000 +0200 >+++ spice-gtk-0.14/gtk/display/gnome-rr-config.c 2012-12-24 13:42:06.674379095 +0200 >@@ -1894,6 +1894,53 @@ > return NULL; > } > >+#ifdef HAVE_X11 >+/* >+ * get_dpi_from_x_server copied from >+ * https://bugzilla.novell.com/show_bug.cgi?id=217790#c20 >+ */ >+#define DPI_FALLBACK 96 >+#define DPI_LOW_REASONABLE_VALUE 50 >+#define DPI_HIGH_REASONABLE_VALUE 500 >+static double >+get_dpi_from_x_server (void) >+{ >+ GdkScreen *screen; >+ double dpi; >+ >+ screen = gdk_screen_get_default (); >+ if (screen) >+ { >+ int width_pixels, width_mm; >+ int height_pixels, height_mm; >+ double width_dpi, height_dpi; >+ >+ width_pixels = gdk_screen_get_width (screen); >+ width_mm = gdk_screen_get_width_mm (screen); >+ >+ height_pixels = gdk_screen_get_height (screen); >+ height_mm = gdk_screen_get_height_mm (screen); >+ >+ width_dpi = width_pixels / (width_mm / 25.4); >+ height_dpi = height_pixels / (height_mm / 25.4); >+ >+ if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE >+ || height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE) >+ dpi = DPI_FALLBACK; >+ else >+ dpi = (width_dpi + height_dpi) / 2.0; >+ } >+ else >+ { >+ /* Huh!? No screen? */ >+ >+ dpi = DPI_FALLBACK; >+ } >+ >+ return dpi; >+} >+#endif >+ > static gboolean > crtc_assignment_apply (CrtcAssignment *assign, guint32 timestamp, GError **error) > { >@@ -1970,8 +2017,12 @@ > * > * Firefox and Evince apparently believe what X tells them. > */ >- width_mm = (width / 96.0) * 25.4 + 0.5; >- height_mm = (height / 96.0) * 25.4 + 0.5; >+ double dpi = 96.0; >+#ifdef HAVE_X11 >+ dpi = get_dpi_from_x_server(); >+#endif >+ width_mm = (width / dpi) * 25.4 + 0.5; >+ height_mm = (height / dpi) * 25.4 + 0.5; > > if (success) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 448362
: 333194