Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP1:Update
notify-osd
notify-osd-fix-workarea.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File notify-osd-fix-workarea.patch of Package notify-osd
--- a/src/defaults.c +++ b/src/defaults.c @@ -1882,34 +1882,57 @@ defaults_get_top_corner (Defaults *self, { GdkRectangle rect; GdkWindow* active_window = NULL; + GdkDisplay * display; GdkDeviceManager* device_manager; GdkDevice* device; gint mx; gint my; - gint monitor = 0; +#if GTK_CHECK_VERSION (3, 22, 0) + GdkMonitor * monitor; + GdkMonitor * aw_monitor; + GdkMonitor * primary_monitor; +#else + gint monitor; gint aw_monitor; + gint primary_monitor; +#endif gboolean follow_focus = defaults_multihead_does_focus_follow (self); gboolean is_composited = FALSE; - gint primary_monitor; g_return_if_fail (self != NULL && IS_DEFAULTS (self)); - device_manager = gdk_display_get_device_manager (gdk_display_get_default ()); + display = gdk_display_get_default (); + device_manager = gdk_display_get_device_manager (display); device = gdk_device_manager_get_client_pointer (device_manager); gdk_device_get_position (device, screen, &mx, &my); +#if GTK_CHECK_VERSION (3, 22, 0) + monitor = gdk_display_get_primary_monitor (display); +#else + monitor = gdk_screen_get_primary_monitor (*screen); +#endif is_composited = gdk_screen_is_composited (*screen); if (follow_focus) { g_debug ("multi_head_focus_follow mode"); +#if GTK_CHECK_VERSION (3, 22, 0) + monitor = gdk_display_get_monitor_at_point (display, mx, my); +#else monitor = gdk_screen_get_monitor_at_point (*screen, mx, my); +#endif active_window = gdk_screen_get_active_window (*screen); if (active_window != NULL) { +#if GTK_CHECK_VERSION (3, 22, 0) + aw_monitor = gdk_display_get_monitor_at_window ( + display, + active_window); +#else aw_monitor = gdk_screen_get_monitor_at_window ( *screen, active_window); +#endif if (monitor != aw_monitor) { @@ -1927,7 +1950,7 @@ defaults_get_top_corner (Defaults *self, /* _NET_WORKAREA is always a rectangle spanning all monitors of * a screen. As such, it can't properly deal with monitor setups * that aren't aligned or have different resolutions. - * gdk_screen_get_monitor_workarea() works around this by only + * gdk_monitor_get_workarea() works around this by only * returning the workarea for the primary screen and the full * geometry for all other monitors. * @@ -1937,28 +1960,43 @@ defaults_get_top_corner (Defaults *self, * other monitors as well. */ +#if GTK_CHECK_VERSION (3, 22, 0) + primary_monitor = gdk_display_get_primary_monitor (display); + if (monitor == primary_monitor) + { + gdk_monitor_get_workarea (primary_monitor, &rect); + } +#else primary_monitor = gdk_screen_get_primary_monitor (*screen); if (monitor == primary_monitor) { gdk_screen_get_monitor_workarea (*screen, primary_monitor, &rect); } +#endif else { GdkRectangle workarea; GdkRectangle primary_geom; gint panel_height; +#if GTK_CHECK_VERSION (3, 22, 0) + gdk_monitor_get_workarea (primary_monitor, &workarea); + gdk_monitor_get_geometry (primary_monitor, &primary_geom); + panel_height = workarea.y - primary_geom.y; + + gdk_monitor_get_geometry (monitor, &rect); +#else gdk_screen_get_monitor_workarea (*screen, primary_monitor, &workarea); gdk_screen_get_monitor_geometry (*screen, primary_monitor, &primary_geom); panel_height = workarea.y - primary_geom.y; gdk_screen_get_monitor_geometry (*screen, monitor, &rect); +#endif rect.y += panel_height; rect.height -= panel_height; } - g_debug ("selecting monitor %d at (%d,%d) - %dx%d", - monitor, + g_debug ("selecting monitor at (%d,%d) - %dx%d", rect.x, rect.y, rect.width,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor