summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-icon-container.c30
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