diff options
author | Pablo Barciela <[email protected]> | 2017-12-04 01:01:52 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-12-16 20:04:18 +0100 |
commit | 2fea2c846689d3810def93e6e0e6eeb01c2ef718 (patch) | |
tree | 3ec5bb043842bbc5e6e9e504a4b4adc2ef22aecf /libcaja-private | |
parent | c6b81f64c4c4212e414c04e584380774d6ac83ca (diff) | |
download | caja-2fea2c846689d3810def93e6e0e6eeb01c2ef718.tar.bz2 caja-2fea2c846689d3810def93e6e0e6eeb01c2ef718.tar.xz |
WidthOfScreen and HeightOfScreen implementation
This commit reverts:
https://github.com/mate-desktop/caja/commit/4c130e22b98bbc1a85747adac3b582e45d34514e
https://github.com/mate-desktop/caja/commit/ac12e6d16f4a51b3327d013781e72cfec17f3624
https://github.com/mate-desktop/caja/commit/17b3c0ca924ffcd4bd06fded98227eba626d4f0b
https://github.com/mate-desktop/caja/commit/42c8d2c3373c25d6e321be6950997c0d7ce44279
And it applies an alternative to fix the deprecated functions:
gdk_screen_get_width
gdk_screen_get_height
gdk_screen_width
gdk_screen_height
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-icon-container.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index c7943964..59e8ab83 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -326,7 +326,6 @@ icon_set_position (CajaIcon *icon, int item_width, item_height; int height_above, width_left; int min_x, max_x, min_y, max_y; - int sc_width, sc_height; if (icon->x == x && icon->y == y) { @@ -355,16 +354,12 @@ icon_set_position (CajaIcon *icon, For now, we have a cheesy workaround: */ - - gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), - NULL, NULL, &sc_width, &sc_height); - container_x = 0; container_y = 0; - container_width = sc_width - container_x + container_width = WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - container_x - container->details->left_margin - container->details->right_margin; - container_height = sc_height - container_y + container_height = HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - container_y - container->details->top_margin - container->details->bottom_margin; pixels_per_unit = EEL_CANVAS (container)->pixels_per_unit; @@ -5290,7 +5285,6 @@ caja_icon_container_search_position_func (CajaIconContainer *container, gint x, y; gint cont_x, cont_y; gint cont_width, cont_height; - gint sc_width, sc_height; GdkWindow *cont_window; GdkScreen *screen; GtkRequisition requisition; @@ -5321,14 +5315,11 @@ caja_icon_container_search_position_func (CajaIconContainer *container, cont_width = gdk_window_get_width (cont_window); cont_height = gdk_window_get_height (cont_window); - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &sc_width, &sc_height); - gtk_widget_get_preferred_size (search_dialog, &requisition, NULL); - if (cont_x + cont_width - requisition.width > sc_width) + if (cont_x + cont_width - requisition.width > WidthOfScreen (gdk_x11_screen_get_xscreen (screen))) { - x = sc_width - requisition.width; + x = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.width; } else if (cont_x + cont_width - requisition.width < 0) { @@ -5339,9 +5330,9 @@ caja_icon_container_search_position_func (CajaIconContainer *container, x = cont_x + cont_width - requisition.width; } - if (cont_y + cont_height > sc_height) + if (cont_y + cont_height > HeightOfScreen (gdk_x11_screen_get_xscreen (screen))) { - y = sc_height - requisition.height; + y = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.height; } else if (cont_y + cont_height < 0) /* isn't really possible ... */ { @@ -6087,7 +6078,6 @@ key_press_event (GtkWidget *widget, const char *new_text; gboolean retval; GdkScreen *screen; - gint sc_width, sc_height; gboolean text_modified; gulong popup_menu_id; @@ -6105,13 +6095,9 @@ key_press_event (GtkWidget *widget, /* Move the entry off screen */ screen = gtk_widget_get_screen (GTK_WIDGET (container)); - - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &sc_width, &sc_height); - gtk_window_move (GTK_WINDOW (container->details->search_window), - sc_width + 1, - sc_height + 1); + WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) + 1, + HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) + 1); gtk_widget_show (container->details->search_window); /* Send the event to the window. If the preedit_changed signal is emitted |