diff options
author | Pablo Barciela <[email protected]> | 2017-12-04 09:31:43 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-12-20 20:40:01 +0100 |
commit | d094cf0297f28b826ca742379750567750dfee9f (patch) | |
tree | b360036c8649bdfc054ed1e7c0cb96be436b38b2 /src/tools | |
parent | 202a8006e2b551ca909c7aa1b67720d699771df3 (diff) | |
download | marco-d094cf0297f28b826ca742379750567750dfee9f.tar.bz2 marco-d094cf0297f28b826ca742379750567750dfee9f.tar.xz |
WidthOfScreen and HeightOfScreen implementation
This commit reverts:
https://github.com/mate-desktop/marco/commit/f0541e3dfda29c26fe14c9c9117f95c49006c75c
https://github.com/mate-desktop/marco/commit/d18c2fb4acb58c408c01700682b9922de86e8b2f
And it applies an alternative to fix the deprecated functions:
gdk_screen_get_width
gdk_screen_width
gdk_screen_height
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/marco-window-demo.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/tools/marco-window-demo.c b/src/tools/marco-window-demo.c index 97fdd31e..8f8041c4 100644 --- a/src/tools/marco-window-demo.c +++ b/src/tools/marco-window-demo.c @@ -559,8 +559,6 @@ make_dock (int type) GtkWidget *image; GtkWidget *box; GtkWidget *button; - int sc_width; - int sc_height; g_return_if_fail (type != DOCK_ALL); @@ -595,9 +593,6 @@ make_dock (int type) gtk_container_add (GTK_CONTAINER (window), box); - gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), - NULL, NULL, &sc_width, &sc_height); - #define DOCK_SIZE 48 switch (type) { @@ -609,7 +604,7 @@ make_dock (int type) break; case DOCK_RIGHT: gtk_widget_set_size_request (window, DOCK_SIZE, 400); - gtk_window_move (GTK_WINDOW (window), sc_width - DOCK_SIZE, 200); + gtk_window_move (GTK_WINDOW (window), WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - DOCK_SIZE, 200); set_gtk_window_struts (window, 0, DOCK_SIZE, 0, 0); gtk_window_set_title (GTK_WINDOW (window), "RightDock"); break; @@ -621,7 +616,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, sc_height - DOCK_SIZE); + gtk_window_move (GTK_WINDOW (window), 200, HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - DOCK_SIZE); set_gtk_window_struts (window, 0, 0, 0, DOCK_SIZE); gtk_window_set_title (GTK_WINDOW (window), "BottomDock"); break; @@ -698,16 +693,13 @@ desktop_cb (GSimpleAction *action, GtkWidget *window; GtkWidget *label; GdkRGBA desktop_color; - int sc_width; - int sc_height; - - gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), - NULL, NULL, &sc_width, &sc_height); 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, sc_width, sc_height); + gtk_widget_set_size_request (window, + WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())), + HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))); gtk_window_move (GTK_WINDOW (window), 0, 0); desktop_color.red = 0.32; |