Take border in account properly.

Mon Apr  6 08:05:23 1998  Owen Taylor  <owt1@cornell.edu>

	* 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.
This commit is contained in:
Owen Taylor 1998-04-06 12:59:06 +00:00 committed by Owen Taylor
parent d7aa6a88fb
commit 0f9fe89727
11 changed files with 125 additions and 13 deletions

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -1,3 +1,19 @@
Mon Apr 6 08:05:23 1998 Owen Taylor <owt1@cornell.edu>
* 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 <gale@gtk.org>
* docs/gtk_tut.sgml examples/helloworld/helloworld.c:

View File

@ -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

View File

@ -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))
{

View File

@ -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);

View File

@ -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