summaryrefslogtreecommitdiff
path: root/charpick
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-05 00:27:00 +0100
committerPablo Barciela <[email protected]>2017-12-05 01:11:03 +0100
commit9736a57f3a39d293daf30401a5ae8463a42b76e4 (patch)
treedd58f141d9d0c73f03fefb2054e17807eb617813 /charpick
parent462cff94c554f3146c6fa7091bc3ff7765fb558a (diff)
downloadmate-applets-9736a57f3a39d293daf30401a5ae8463a42b76e4.tar.bz2
mate-applets-9736a57f3a39d293daf30401a5ae8463a42b76e4.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/mate-applets/commit/d809e57c7b09f545f1cf847f514fa738d44ac2b3 https://github.com/mate-desktop/mate-applets/commit/2f5515815c1f6c9b66f85d6ec228aad7aea0b441 And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height gdk_screen_width gdk_screen_height
Diffstat (limited to 'charpick')
-rw-r--r--charpick/charpick.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/charpick/charpick.c b/charpick/charpick.c
index e6f4fa74..b7863238 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -2,6 +2,7 @@
* accented (and other) characters to be pasted into other apps.
*/
+#include <gdk/gdkx.h>
#include <config.h>
#include <string.h>
#include <mate-panel-applet.h>
@@ -355,10 +356,8 @@ get_menu_pos (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
tempx += width;
break;
}
-
- gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()),
- NULL, NULL, &screen_width, &screen_height);
-
+ screen_width = WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()));
+ screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()));
*x = CLAMP (tempx, 0, MAX (0, screen_width - reqmenu.width));
*y = CLAMP (tempy, 0, MAX (0, screen_height - reqmenu.height));
}