summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2009-03-11 23:27:07 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2009-03-11 23:27:07 +0000
commit20708e38276b13c410b49e7ce6b2df16e8485101 (patch)
treec54eb6f98219a5c8066ad8964ac536da715efd87
parent66117983c06ef648d64a3588649d4f4afc736022 (diff)
downloadgtk+-20708e38276b13c410b49e7ce6b2df16e8485101.tar.gz
Fix problems with window positioning
svn path=/trunk/; revision=22524
-rw-r--r--ChangeLog7
-rw-r--r--gtk/gtkentry.c14
2 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c45f5ef09f..c983ad9c75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-11 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 572455 – GtkEntry window layed out wrong if the widget has focus
+
+ * gtk/gtkentry.c: Fix problems with window positioning. Reported
+ by Benjamin Berg.
+
2009-03-11 Tor Lillqvist <tml@iki.fi>
Bug 573067 - Intra-app dnd of text behavior on Windows is wrong
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index be1a83e65d..607ef878a5 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -2265,6 +2265,9 @@ get_icon_allocations (GtkEntry *entry,
get_text_area_size (entry, &x, &y, &width, &height);
+ if (GTK_WIDGET_HAS_FOCUS (entry) && !priv->interior_focus)
+ y += priv->focus_width;
+
primary->y = y;
primary->height = height;
primary->width = get_icon_width (entry, GTK_ENTRY_ICON_PRIMARY);
@@ -2784,7 +2787,6 @@ gtk_entry_size_request (GtkWidget *widget,
static void
place_windows (GtkEntry *entry)
-
{
GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);
gint x, y, width, height;
@@ -2793,9 +2795,11 @@ place_windows (GtkEntry *entry)
EntryIconInfo *icon_info = NULL;
get_text_area_size (entry, &x, &y, &width, &height);
-
get_icon_allocations (entry, &primary, &secondary);
+ if (GTK_WIDGET_HAS_FOCUS (entry) && !priv->interior_focus)
+ y += priv->focus_width;
+
if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL)
x += secondary.width;
else
@@ -2803,7 +2807,7 @@ place_windows (GtkEntry *entry)
width -= primary.width + secondary.width;
if ((icon_info = priv->icons[GTK_ENTRY_ICON_PRIMARY]) != NULL)
- gdk_window_move_resize (icon_info->window,
+ gdk_window_move_resize (icon_info->window,
primary.x, primary.y,
primary.width, primary.height);
@@ -2949,7 +2953,7 @@ gtk_entry_size_allocate (GtkWidget *widget,
GtkEntryCompletion* completion;
get_widget_window_size (entry, &x, &y, &width, &height);
- gdk_window_move_resize (widget->window, x, y, width, height);
+ gdk_window_move_resize (widget->window, x, y, width, height);
place_windows (entry);
gtk_entry_recompute (entry);
@@ -4010,7 +4014,7 @@ gtk_entry_focus_out (GtkWidget *widget,
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryCompletion *completion;
GdkKeymap *keymap;
-
+
gtk_widget_queue_draw (widget);
keymap = gdk_keymap_get_for_display (gtk_widget_get_display (widget));