diff options
author | osch <oliver at luced de> | 2019-05-24 20:34:16 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-03 14:14:38 +0200 |
commit | 707eb409e7dfeec276f6dfa3e667a0140b3300aa (patch) | |
tree | 88eb1ef90de077b0b94736a83943480d81378ec4 /src/core/display.c | |
parent | 11b7ff55b020573b3ecf4e841c2b1d60ca74f4b8 (diff) | |
download | marco-707eb409e7dfeec276f6dfa3e667a0140b3300aa.tar.bz2 marco-707eb409e7dfeec276f6dfa3e667a0140b3300aa.tar.xz |
alt+tab popup: bugfix mouse click handling for scale factor > 1
Diffstat (limited to 'src/core/display.c')
-rw-r--r-- | src/core/display.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/core/display.c b/src/core/display.c index 65ae1885..216688ec 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1611,18 +1611,30 @@ mouse_event_is_in_tab_popup (MetaDisplay *display, event_window, event_window, event_x, event_y, &x, &y, &child1); + + GtkWidget *popup_widget = meta_ui_tab_popup_get_widget (screen->tab_popup); + if (ok1 && popup_widget != NULL) + { + Window popup_xid = gdk_x11_window_get_xid (gtk_widget_get_window (popup_widget)); - Window popup_xid = meta_ui_tab_popup_get_xid(screen->tab_popup); - - gboolean ok2 = XTranslateCoordinates (display->xdisplay, - event_window, popup_xid, - event_x, event_y, - popup_x, popup_y, &child2); + gboolean ok2 = XTranslateCoordinates (display->xdisplay, + event_window, popup_xid, + event_x, event_y, + popup_x, popup_y, &child2); - return (ok1 && ok2 && child1 == popup_xid); + if (ok2 && child1 == popup_xid) + { + int scale = gtk_widget_get_scale_factor (popup_widget); + if (scale != 0) + { + *popup_x /= scale; + *popup_y /= scale; + } + return TRUE; + } + } } - else - return FALSE; + return FALSE; } /** |