diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-01-05 23:46:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-01-05 23:46:49 +0000 |
commit | 5126b13c0a27f93676e006cd681aea1eca6f88f8 (patch) | |
tree | e65a4866ebfb6a463d7929975d8d2f974725b0c3 | |
parent | 1fd7a6e491b6b76f9281bb14e6161a75df71bf5e (diff) | |
download | gdk-pixbuf-5126b13c0a27f93676e006cd681aea1eca6f88f8.tar.gz |
When redrawing the under-cursor character, don't redraw the terminating
Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing the under-cursor character, don't
redraw the terminating NULL.
[ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ]
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 42 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 42 | ||||
-rw-r--r-- | gtk/gtkentry.c | 14 | ||||
-rw-r--r-- | gtk/gtkpreview.c | 65 |
9 files changed, 358 insertions, 15 deletions
@@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8c6aea934..051eedb28 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,45 @@ +Tue Jan 5 15:03:47 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Make + gtk_propagate_event() non-static, we need it in gtkdnd.c + so that the button-release we synthesize gets propagated + correctly. + + * gtk/gtkdnd.c: Use gtk_propagate_event() so + release gets to a GtkList. But we can't really + get this right without access to the windows + event masks and doing X-style propagation ourselves. + +Tue Jan 5 12:40:57 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkpreview.c: Add a size_allocate() routine + and set the size of the preview window equal + to the area we are going to draw on, instead + of the entire allocation. Do this to avoid having + to set a parent-relative background. + +Tue Jan 5 11:51:32 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): + When redrawing the under-cursor character, don't + redraw the terminating NULL. + [ From: dov@imagic.weizmann.ac.il (Dov Grobgeld) ] + +Tue Jan 5 11:31:55 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkselection.c (gtk_target_list_unref): Free + memory allocated for target lists. + + * gtk/gtkdnd.c (gtk_drag_drop_finished): Release + selections before destroying info structure. + + * gdk/gdkdnd.c gdktypes.h (gdk_drag_get_protocol): Add + new value GDK_DRAG_PROTO_NONE, use it for non-drag + targets, to quiet Purify. + + * gdk/gdkdnd.c (gdk_window_register_dnd): Set size + of property properly. + Mon Jan 4 03:45:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * Released GTK+ 1.1.12 diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 7271156b0..cdb06877f 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1454,12 +1454,14 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable) NULL, widget, "entry_bg", xoffset, INNER_BORDER, 1, text_area_height - INNER_BORDER); - /* Draw the character under the cursor again */ - - gdk_draw_text_wc (drawable, widget->style->font, - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], - xoffset, yoffset, - entry->text + editable->current_pos, 1); + + /* Draw the character under the cursor again + */ + if (editable->current_pos < entry->text_length) + gdk_draw_text_wc (drawable, widget->style->font, + widget->style->fg_gc[GTK_WIDGET_STATE (widget)], + xoffset, yoffset, + entry->text + editable->current_pos, 1); } diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c index 05df6d983..ef546c778 100644 --- a/gtk/gtkpreview.c +++ b/gtk/gtkpreview.c @@ -34,6 +34,8 @@ static void gtk_preview_class_init (GtkPreviewClass *klass); static void gtk_preview_init (GtkPreview *preview); static void gtk_preview_finalize (GtkObject *object); static void gtk_preview_realize (GtkWidget *widget); +static void gtk_preview_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); static gint gtk_preview_expose (GtkWidget *widget, GdkEventExpose *event); static void gtk_preview_make_buffer (GtkPreview *preview); @@ -84,6 +86,7 @@ gtk_preview_class_init (GtkPreviewClass *klass) object_class->finalize = gtk_preview_finalize; widget_class->realize = gtk_preview_realize; + widget_class->size_allocate = gtk_preview_size_allocate; widget_class->expose_event = gtk_preview_expose; klass->info.visual = NULL; @@ -406,10 +409,21 @@ gtk_preview_realize (GtkWidget *widget) preview = GTK_PREVIEW (widget); attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; + + if (preview->expand) + { + attributes.width = widget->allocation.width; + attributes.height = widget->allocation.height; + } + else + { + attributes.width = MIN (widget->requisition.width, widget->allocation.width); + attributes.height = MIN (widget->requisition.height, widget->allocation.height); + } + + attributes.x = widget->allocation.x + (widget->allocation.width - attributes.width) / 2; + attributes.y = widget->allocation.y + (widget->allocation.height - attributes.height) / 2;; + attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = preview_class->info.visual; attributes.colormap = preview_class->info.cmap; @@ -421,7 +435,39 @@ gtk_preview_realize (GtkWidget *widget) widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); - gdk_window_set_back_pixmap (widget->window, NULL, TRUE); +} + +static void +gtk_preview_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + GtkPreview *preview; + gint width, height; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_PREVIEW (widget)); + + preview = GTK_PREVIEW (widget); + widget->allocation = *allocation; + + if (GTK_WIDGET_REALIZED (widget)) + { + if (preview->expand) + { + width = widget->allocation.width; + height = widget->allocation.height; + } + else + { + width = MIN (widget->allocation.width, widget->requisition.width); + height = MIN (widget->allocation.height, widget->requisition.height); + } + + gdk_window_move_resize (widget->window, + widget->allocation.x + (widget->allocation.width - width) / 2, + widget->allocation.y + (widget->allocation.height - height) / 2, + width, height); + } } static gint @@ -429,6 +475,7 @@ gtk_preview_expose (GtkWidget *widget, GdkEventExpose *event) { GtkPreview *preview; + gint width, height; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_PREVIEW (widget), FALSE); @@ -438,12 +485,12 @@ gtk_preview_expose (GtkWidget *widget, { preview = GTK_PREVIEW (widget); + gdk_window_get_size (widget->window, &width, &height); + gtk_preview_put (GTK_PREVIEW (widget), widget->window, widget->style->black_gc, - event->area.x - - (widget->allocation.width - preview->buffer_width)/2, - event->area.y - - (widget->allocation.height - preview->buffer_height)/2, + event->area.x - (width - preview->buffer_width)/2, + event->area.y - (height - preview->buffer_height)/2, event->area.x, event->area.y, event->area.width, event->area.height); } |