[libgnomekbd] gkbd-keyboard-drawing: Don't use deprecated GDK API
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnomekbd] gkbd-keyboard-drawing: Don't use deprecated GDK API
- Date: Wed, 14 Sep 2016 19:43:12 +0000 (UTC)
commit 9e31770f725514a12db8b7bf2bfbd9128de31045
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Sep 13 18:26:21 2016 +0200
gkbd-keyboard-drawing: Don't use deprecated GDK API
Asking for a keyboard device's position doesn't even make sense
anyway.
libgnomekbd/gkbd-keyboard-drawing.c | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/libgnomekbd/gkbd-keyboard-drawing.c b/libgnomekbd/gkbd-keyboard-drawing.c
index dc6d82f..da526d2 100644
--- a/libgnomekbd/gkbd-keyboard-drawing.c
+++ b/libgnomekbd/gkbd-keyboard-drawing.c
@@ -2125,20 +2125,11 @@ get_preferred_width (GtkWidget * widget,
{
GdkRectangle rect;
gint w, monitor;
- GdkDisplay *display = gtk_widget_get_display (widget);
- GdkDeviceManager *gdm = gdk_display_get_device_manager (display);
GdkScreen *scr = NULL;
- GList *devices =
- gdk_device_manager_list_devices (gdm, GDK_SOURCE_KEYBOARD);
- if (g_list_length (devices) > 0) {
- gint x, y;
- GdkDevice *dev = GDK_DEVICE (devices->data);
- gdk_device_get_position (dev, &scr, &x, &y);
- monitor = gdk_screen_get_monitor_at_point (scr, x, y);
- } else {
- scr = gdk_screen_get_default ();
- monitor = gdk_screen_get_primary_monitor (scr);
- }
+
+ scr = gdk_screen_get_default ();
+ monitor = gdk_screen_get_primary_monitor (scr);
+
gdk_screen_get_monitor_geometry (scr, monitor, &rect);
w = rect.width;
*minimum_width = *natural_width = w - (w >> 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]