Commit 65094d38 authored by Pablo Barciela's avatar Pablo Barciela Committed by raveit65

WidthOfScreen and HeightOfScreen implementation

This commit reverts:

https://github.com/mate-desktop/mate-screensaver/commit/816394c1a6ce9968dba3e1b0ecc884c8ccca4d43

And it applies an alternative to fix the deprecated functions:

gdk_screen_get_width
gdk_screen_get_height
parent 02cddede
...@@ -1320,10 +1320,8 @@ apply_background_to_window (GSManager *manager, ...@@ -1320,10 +1320,8 @@ apply_background_to_window (GSManager *manager,
display = gs_window_get_display (window); display = gs_window_get_display (window);
screen = gdk_display_get_default_screen (display); screen = gdk_display_get_default_screen (display);
width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
&width, &height);
gs_debug ("Creating background w:%d h:%d", width, height); gs_debug ("Creating background w:%d h:%d", width, height);
surface = mate_bg_create_surface (manager->priv->bg, surface = mate_bg_create_surface (manager->priv->bg,
gs_window_get_gdk_window (window), gs_window_get_gdk_window (window),
......
...@@ -1272,12 +1272,8 @@ create_keyboard_socket (GSWindow *window, ...@@ -1272,12 +1272,8 @@ create_keyboard_socket (GSWindow *window,
guint32 id) guint32 id)
{ {
int height; int height;
int sc_height;
gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (GTK_WIDGET (window))), height = (HeightOfScreen (gdk_x11_screen_get_xscreen (gtk_widget_get_screen (GTK_WIDGET (window))))) / 4;
NULL, NULL, NULL, &sc_height);
height = sc_height / 4;
window->priv->keyboard_socket = gtk_socket_new (); window->priv->keyboard_socket = gtk_socket_new ();
gtk_widget_set_size_request (window->priv->keyboard_socket, -1, height); gtk_widget_set_size_request (window->priv->keyboard_socket, -1, height);
...@@ -2166,17 +2162,12 @@ gs_window_real_motion_notify_event (GtkWidget *widget, ...@@ -2166,17 +2162,12 @@ gs_window_real_motion_notify_event (GtkWidget *widget,
gdouble min_percentage = 0.1; gdouble min_percentage = 0.1;
GdkDisplay *display; GdkDisplay *display;
GdkScreen *screen; GdkScreen *screen;
gint sc_width;
window = GS_WINDOW (widget); window = GS_WINDOW (widget);
display = gs_window_get_display (window); display = gs_window_get_display (window);
screen = gdk_display_get_default_screen (display); screen = gdk_display_get_default_screen (display);
min_distance = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) * min_percentage;
gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
&sc_width, NULL);
min_distance = sc_width * min_percentage;
/* if the last position was not set then don't detect motion */ /* if the last position was not set then don't detect motion */
if (window->priv->last_x < 0 || window->priv->last_y < 0) if (window->priv->last_x < 0 || window->priv->last_y < 0)
......
...@@ -1284,13 +1284,9 @@ constrain_list_size (GtkWidget *widget, ...@@ -1284,13 +1284,9 @@ constrain_list_size (GtkWidget *widget,
{ {
GtkRequisition req; GtkRequisition req;
int max_height; int max_height;
int sc_height;
/* constrain height to be the tree height up to a max */ /* constrain height to be the tree height up to a max */
gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), max_height = (HeightOfScreen (gdk_x11_screen_get_xscreen (gtk_widget_get_screen (widget)))) / 4;
NULL, NULL, NULL, &sc_height);
max_height = sc_height / 4;
gtk_widget_get_preferred_size (to_size, &req, NULL); gtk_widget_get_preferred_size (to_size, &req, NULL);
allocation->height = MIN (req.height, max_height); allocation->height = MIN (req.height, max_height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment