[metacity] metacity-window-demo: avoid deprecation warnings
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] metacity-window-demo: avoid deprecation warnings
- Date: Tue, 25 Oct 2016 22:28:03 +0000 (UTC)
commit 421e1ebb2fd9781ffd7d0da2691d84bd8f96648d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Oct 26 01:21:24 2016 +0300
metacity-window-demo: avoid deprecation warnings
src/tools/metacity-window-demo.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index 888de80..a5f8ef5 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -560,6 +560,8 @@ make_dock (int type)
GtkWidget *image;
GtkWidget *box;
GtkWidget *button;
+ GdkScreen *screen;
+ GdkWindow *root;
g_return_if_fail (type != DOCK_ALL);
@@ -594,6 +596,9 @@ make_dock (int type)
gtk_container_add (GTK_CONTAINER (window), box);
+ screen = gdk_screen_get_default ();
+ root = gdk_screen_get_root_window (screen);
+
#define DOCK_SIZE 48
switch (type)
{
@@ -605,7 +610,7 @@ make_dock (int type)
break;
case DOCK_RIGHT:
gtk_widget_set_size_request (window, DOCK_SIZE, 400);
- gtk_window_move (GTK_WINDOW (window), gdk_screen_width () - DOCK_SIZE, 200);
+ gtk_window_move (GTK_WINDOW (window), gdk_window_get_width (root) - DOCK_SIZE, 200);
set_gtk_window_struts (window, 0, DOCK_SIZE, 0, 0);
gtk_window_set_title (GTK_WINDOW (window), "RightDock");
break;
@@ -617,7 +622,7 @@ make_dock (int type)
break;
case DOCK_BOTTOM:
gtk_widget_set_size_request (window, 600, DOCK_SIZE);
- gtk_window_move (GTK_WINDOW (window), 200, gdk_screen_height () - DOCK_SIZE);
+ gtk_window_move (GTK_WINDOW (window), 200, gdk_window_get_height (root) - DOCK_SIZE);
set_gtk_window_struts (window, 0, 0, 0, DOCK_SIZE);
gtk_window_set_title (GTK_WINDOW (window), "BottomDock");
break;
@@ -689,15 +694,21 @@ desktop_cb (GSimpleAction *action,
GVariant *parameter,
gpointer callback_data)
{
+ GdkScreen *screen;
+ GdkWindow *root;
GtkWidget *window;
GtkWidget *label;
GdkRGBA desktop_color;
+ screen = gdk_screen_get_default ();
+ root = gdk_screen_get_root_window (screen);
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
set_gtk_window_type (GTK_WINDOW (window), "_NET_WM_WINDOW_TYPE_DESKTOP");
gtk_window_set_title (GTK_WINDOW (window), "Desktop");
gtk_widget_set_size_request (window,
- gdk_screen_width (), gdk_screen_height ());
+ gdk_window_get_width (root),
+ gdk_window_get_height (root));
gtk_window_move (GTK_WINDOW (window), 0, 0);
desktop_color.red = 0.32;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]