@@ -1224,8 +1224,7 @@ get_window_pixbuf (MetaWindow *window,
12241224 MetaDisplay * display ;
12251225 cairo_surface_t * surface ;
12261226 GdkPixbuf * pixbuf , * scaled ;
1227- GdkMonitor * monitor ;
1228- GdkRectangle rect ;
1227+ const MetaXineramaScreenInfo * current ;
12291228 double ratio ;
12301229
12311230 display = window -> display ;
@@ -1248,28 +1247,19 @@ get_window_pixbuf (MetaWindow *window,
12481247 * width = gdk_pixbuf_get_width (pixbuf );
12491248 * height = gdk_pixbuf_get_height (pixbuf );
12501249
1251- monitor = meta_screen_get_current_monitor ();
1252- if (monitor != NULL )
1253- {
1254- gdk_monitor_get_geometry (monitor , & rect );
1255- }
1256- else
1257- {
1258- rect .width = window -> screen -> rect .width ;
1259- rect .height = window -> screen -> rect .height ;
1260- }
1250+ current = meta_screen_get_current_xinerama (window -> screen );
12611251
12621252 /* Scale pixbuf to max dimension based on monitor size */
12631253 if (* width > * height )
12641254 {
1265- int max_preview_width = rect .width / MAX_PREVIEW_SCALE ;
1255+ int max_preview_width = current -> rect .width / MAX_PREVIEW_SCALE ;
12661256 ratio = ((double ) * width ) / max_preview_width ;
12671257 * width = (int ) max_preview_width ;
12681258 * height = (int ) (((double ) * height ) / ratio );
12691259 }
12701260 else
12711261 {
1272- int max_preview_height = rect .height / MAX_PREVIEW_SCALE ;
1262+ int max_preview_height = current -> rect .height / MAX_PREVIEW_SCALE ;
12731263 ratio = ((double ) * height ) / max_preview_height ;
12741264 * height = (int ) max_preview_height ;
12751265 * width = (int ) (((double ) * width ) / ratio );
@@ -1812,29 +1802,6 @@ meta_screen_get_current_xinerama (MetaScreen *screen)
18121802 return & screen -> xinerama_infos [screen -> last_xinerama_index ];
18131803}
18141804
1815- GdkMonitor *
1816- meta_screen_get_current_monitor ()
1817- {
1818- GdkDisplay * display ;
1819- GdkSeat * seat ;
1820- GdkDevice * device ;
1821- GdkMonitor * current ;
1822- gint x , y ;
1823-
1824- display = gdk_display_get_default ();
1825- seat = gdk_display_get_default_seat (display );
1826- device = gdk_seat_get_pointer (seat );
1827-
1828- gdk_device_get_position (device , NULL , & x , & y );
1829- current = gdk_display_get_monitor_at_point (display , x , y );
1830-
1831- if (current != NULL ) {
1832- return current ;
1833- }
1834-
1835- return gdk_display_get_primary_monitor (display );
1836- }
1837-
18381805#define _NET_WM_ORIENTATION_HORZ 0
18391806#define _NET_WM_ORIENTATION_VERT 1
18401807
0 commit comments