summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2011-01-12 15:35:16 -0500
committerRay Strode <rstrode@redhat.com>2011-01-18 17:42:51 -0500
commit9004c8bf88e5f2ad0884a6163228040114ce2516 (patch)
tree0978b7c8f2260eca43f3ed717f1e24f7b9748048 /utils
parentdb8de4d655b644f6e21a0f69f21cd285cb2fbc32 (diff)
downloadgdm-9004c8bf88e5f2ad0884a6163228040114ce2516.tar.gz
Port to GTK3
https://bugzilla.gnome.org/show_bug.cgi?id=639284
Diffstat (limited to 'utils')
-rw-r--r--utils/gdm-screenshot.c26
-rw-r--r--utils/gdmflexiserver.c4
2 files changed, 13 insertions, 17 deletions
diff --git a/utils/gdm-screenshot.c b/utils/gdm-screenshot.c
index 1b9e31b5..c5802753 100644
--- a/utils/gdm-screenshot.c
+++ b/utils/gdm-screenshot.c
@@ -57,8 +57,8 @@ screenshot_grab_lock (void)
gboolean result = FALSE;
selection_atom = gdk_x11_get_xatom_by_name (SELECTION_NAME);
- XGrabServer (GDK_DISPLAY ());
- if (XGetSelectionOwner (GDK_DISPLAY(), selection_atom) != None) {
+ XGrabServer (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+ if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), selection_atom) != None) {
goto out;
}
@@ -81,7 +81,7 @@ screenshot_grab_lock (void)
result = TRUE;
out:
- XUngrabServer (GDK_DISPLAY ());
+ XUngrabServer (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
gdk_flush ();
return result;
@@ -114,13 +114,13 @@ screenshot_get_pixbuf (Window w)
int width;
int height;
- window = gdk_window_foreign_new (w);
+ window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), w);
if (window == NULL) {
return NULL;
}
- root = gdk_window_foreign_new (GDK_ROOT_WINDOW ());
- gdk_drawable_get_size (window, &real_width, &real_height);
+ root = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), GDK_ROOT_WINDOW ());
+ gdk_window_get_geometry (window, NULL, NULL, &real_width, &real_height);
gdk_window_get_origin (window, &x_real_orig, &y_real_orig);
x_orig = x_real_orig;
@@ -144,15 +144,11 @@ screenshot_get_pixbuf (Window w)
height = gdk_screen_height () - y_orig;
}
- screenshot = gdk_pixbuf_get_from_drawable (NULL,
- root,
- NULL,
- x_orig,
- y_orig,
- 0,
- 0,
- width,
- height);
+ screenshot = gdk_pixbuf_get_from_window (root,
+ x_orig,
+ y_orig,
+ width,
+ height);
return screenshot;
}
diff --git a/utils/gdmflexiserver.c b/utils/gdmflexiserver.c
index fdcbfb1c..41551a2a 100644
--- a/utils/gdmflexiserver.c
+++ b/utils/gdmflexiserver.c
@@ -116,7 +116,7 @@ maybe_lock_screen (void)
screen = gdk_screen_get_default ();
- if (! gdk_spawn_command_line_on_screen (screen, command, &error)) {
+ if (! g_spawn_command_line_async (command, &error)) {
g_warning ("Cannot lock screen: %s", error->message);
g_error_free (error);
}
@@ -125,7 +125,7 @@ maybe_lock_screen (void)
if (! use_gscreensaver) {
command = g_strdup ("xscreensaver-command -throttle");
- if (! gdk_spawn_command_line_on_screen (screen, command, &error)) {
+ if (! g_spawn_command_line_async (command, &error)) {
g_warning ("Cannot disable screensaver engines: %s", error->message);
g_error_free (error);
}