From 0f9fe897271c008339b2d3e79a9dc7d0d71d26f9 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 6 Apr 1998 12:59:06 +0000 Subject: [PATCH] Take border in account properly. Mon Apr 6 08:05:23 1998 Owen Taylor * gtk/gtkbutton.c (gtk_button_paint): Take border in account properly. * gtk/gtktext.c (gtk_text_realize): Don't recompute geometry when creating with initial 1x1 geometry, since our calculations can't handle that. Leave text->line_start_cache NULL as sign we don't have a real geometry yet. * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x value we get from gdk_window_get_pointer, not from event->x - since we always specify OwnerGrabButtonMask (why???), event->x can refer to another window. --- ChangeLog | 16 ++++++++++++++++ ChangeLog.pre-2-0 | 16 ++++++++++++++++ ChangeLog.pre-2-10 | 16 ++++++++++++++++ ChangeLog.pre-2-2 | 16 ++++++++++++++++ ChangeLog.pre-2-4 | 16 ++++++++++++++++ ChangeLog.pre-2-6 | 16 ++++++++++++++++ ChangeLog.pre-2-8 | 16 ++++++++++++++++ docs/debugging.txt | 9 ++++----- gtk/gtkbutton.c | 12 ++++++------ gtk/gtkentry.c | 2 +- gtk/gtktext.c | 3 ++- 11 files changed, 125 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8fa9fbfc53..74f28fd0e2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,19 @@ +Mon Apr 6 08:05:23 1998 Owen Taylor + + * gtk/gtkbutton.c (gtk_button_paint): Take border in + account properly. + + * gtk/gtktext.c (gtk_text_realize): Don't recompute + geometry when creating with initial 1x1 geometry, + since our calculations can't handle that. Leave + text->line_start_cache NULL as sign we don't have + a real geometry yet. + + * gtk/gtkentry.c (gtk_entry_motion_notify): Use the x + value we get from gdk_window_get_pointer, not from + event->x - since we always specify OwnerGrabButtonMask + (why???), event->x can refer to another window. + Mon Apr 6 08:08:49 BST 1998 Tony Gale * docs/gtk_tut.sgml examples/helloworld/helloworld.c: diff --git a/docs/debugging.txt b/docs/debugging.txt index 68905895c2..db46439ed8 100644 --- a/docs/debugging.txt +++ b/docs/debugging.txt @@ -53,11 +53,10 @@ by the: First the environment variables are applied, then the command line options are applied in the order given on the command line. -Each of these can either be the special value ALL, or a sequence of -':' separated options. (Note, case is significant). The environment -variables and the --gtk-debug and --gdk-debug options add debugging -options and the --gtk-no-debug and --gdk-no-debug options remove -them. +Each of these can either be the special value 'all', or a sequence of +':' separated options. (case is ignored). The environment variables +and the --gtk-debug and --gdk-debug options add debugging options and +the --gtk-no-debug and --gdk-no-debug options remove them. As noted below, some of these are useful in application debugging, but most are only interested to those debugging the libraries diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 5ded0987b8..884a5a8244 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -454,12 +454,12 @@ gtk_button_paint (GtkWidget *widget, if (GTK_WIDGET_DRAWABLE (widget)) { - restrict_area.x = (GTK_WIDGET (widget)->style->klass->xthickness + - GTK_CONTAINER (widget)->border_width); - restrict_area.y = (GTK_WIDGET (widget)->style->klass->ythickness + - GTK_CONTAINER (widget)->border_width); - restrict_area.width = GTK_WIDGET (widget)->allocation.width - restrict_area.x * 2; - restrict_area.height = GTK_WIDGET (widget)->allocation.height - restrict_area.y * 2; + restrict_area.x = GTK_WIDGET (widget)->style->klass->xthickness; + restrict_area.y = GTK_WIDGET (widget)->style->klass->ythickness; + restrict_area.width = GTK_WIDGET (widget)->allocation.width - + restrict_area.x * 2 - GTK_CONTAINER (widget)->border_width * 2; + restrict_area.height = GTK_WIDGET (widget)->allocation.height - + restrict_area.y * 2 - GTK_CONTAINER (widget)->border_width * 2; if (GTK_WIDGET_CAN_DEFAULT (widget)) { diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 7c1c63bdc7..2a7b067318 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -870,7 +870,7 @@ gtk_entry_motion_notify (GtkWidget *widget, if (event->is_hint || (entry->text_area != event->window)) gdk_window_get_pointer (entry->text_area, &x, NULL, NULL); - GTK_EDITABLE(entry)->selection_end_pos = gtk_entry_position (entry, event->x + entry->scroll_offset); + GTK_EDITABLE(entry)->selection_end_pos = gtk_entry_position (entry, x + entry->scroll_offset); GTK_EDITABLE(entry)->current_pos = GTK_EDITABLE(entry)->selection_end_pos; gtk_entry_adjust_scroll (entry); gtk_entry_queue_draw (entry); diff --git a/gtk/gtktext.c b/gtk/gtktext.c index cccc6361c0..bb3d6d7a9a 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -1054,7 +1054,8 @@ gtk_text_realize (GtkWidget *widget) if (editable->selection_start_pos != editable->selection_end_pos) gtk_editable_claim_selection (editable, TRUE, GDK_CURRENT_TIME); - recompute_geometry (text); + if ((widget->allocation.width > 1) || (widget->allocation.height > 1)) + recompute_geometry (text); } static void