diff options
author | William Wold <[email protected]> | 2019-06-18 05:59:48 +0000 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-20 08:15:12 +0200 |
commit | 5d2fbbe19a33a99d4ba2b7e4f715e6b6ea8d229e (patch) | |
tree | b602b174ad4bfd5894436d02baa992a6657a03d4 | |
parent | 0f6aa310eb1dbb8f2df599318d3835101b606faf (diff) | |
download | mate-panel-5d2fbbe19a33a99d4ba2b7e4f715e6b6ea8d229e.tar.bz2 mate-panel-5d2fbbe19a33a99d4ba2b7e4f715e6b6ea8d229e.tar.xz |
Panel addto Wayland support
-rw-r--r-- | mate-panel/panel-addto.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c index dfebba26..bd16ea33 100644 --- a/mate-panel/panel-addto.c +++ b/mate-panel/panel-addto.c @@ -27,7 +27,6 @@ #include <glib/gi18n.h> #include <gio/gio.h> -#include <gdk/gdkx.h> #include <matemenu-tree.h> @@ -54,6 +53,13 @@ #include "panel-schemas.h" #include "panel-stock-icons.h" +#ifdef HAVE_X11 +#include "xstuff.h" +#endif +#ifdef HAVE_WAYLAND +#include "gdk/gdkwayland.h" +#endif + typedef struct { PanelWidget *panel_widget; @@ -1375,7 +1381,8 @@ panel_addto_present (GtkMenuItem *item, PanelToplevel *toplevel; PanelData *pd; GdkScreen *screen; - gint screen_height; + GdkMonitor *monitor; + GdkRectangle monitor_geom; gint height; toplevel = panel_widget->toplevel; @@ -1389,8 +1396,10 @@ panel_addto_present (GtkMenuItem *item, panel_addto_dialog_quark); screen = gtk_window_get_screen (GTK_WINDOW (toplevel)); - screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)); - height = MIN (MAX_ADDTOPANEL_HEIGHT, 3 * (screen_height / 4)); + monitor = gdk_display_get_monitor_at_window (gtk_widget_get_display (GTK_WIDGET (toplevel)), + gtk_widget_get_window (GTK_WIDGET (toplevel))); + gdk_monitor_get_geometry (monitor, &monitor_geom); + height = MIN (MAX_ADDTOPANEL_HEIGHT, 3 * (monitor_geom.height / 4)); if (!dialog) { dialog = panel_addto_dialog_new (panel_widget); |