From f5ba27007c359c933631d30dac4593c147c5e01e Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Wed, 9 Aug 2023 07:17:27 -0400 Subject: dictionary applet: allow building in-process *This is needed for wayland support --- mate-dictionary/src/gdict-aligned-window.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mate-dictionary/src/gdict-aligned-window.c') diff --git a/mate-dictionary/src/gdict-aligned-window.c b/mate-dictionary/src/gdict-aligned-window.c index ed2a08fe..42a00cc9 100644 --- a/mate-dictionary/src/gdict-aligned-window.c +++ b/mate-dictionary/src/gdict-aligned-window.c @@ -154,8 +154,10 @@ gdict_aligned_window_position (GdictAlignedWindow *window) gint entry_x, entry_y, entry_width, entry_height; gint x, y; GdkGravity gravity = GDK_GRAVITY_NORTH_WEST; - GdkWindow *gdk_window; + GdkWindow *gdk_window; GdkDisplay *display; + GdkMonitor *monitor; + GdkRectangle geometry = {0}; g_assert (GDICT_IS_ALIGNED_WINDOW (window)); priv = window->priv; @@ -185,7 +187,12 @@ gdict_aligned_window_position (GdictAlignedWindow *window) &entry_y); gdk_window_get_geometry (gdk_window, NULL, NULL, &entry_width, &entry_height); - if (entry_x + our_width < WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))) + /*Get the monitor dimensions*/ + display= gdk_screen_get_display (gdk_screen_get_default ()); + monitor = gdk_display_get_monitor (display, 0); + gdk_monitor_get_geometry (monitor, &geometry); + + if (entry_x + our_width < geometry.width) x = entry_x + 1; else { @@ -194,7 +201,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window) gravity = GDK_GRAVITY_NORTH_EAST; } - if (entry_y + entry_height + our_height < HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))) + if (entry_y + entry_height + our_height < geometry.height) y = entry_y + entry_height - 1; else { -- cgit v1.2.1