diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-01-26 05:50:53 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-01-26 05:50:53 +0000 |
commit | e5b7ec7e362a88315130839030e7ec23c5613239 (patch) | |
tree | cfeaf55779d8879d1181bfac246ac03bb68ebc34 | |
parent | b269eb087462cbe1c44756835cd62d63458551d3 (diff) | |
download | gdk-pixbuf-e5b7ec7e362a88315130839030e7ec23c5613239.tar.gz |
Finish the job of allowing event to be NULL. (Fixes bug #4283, reported by
Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions):
Finish the job of allowing event to be NULL.
(Fixes bug #4283, reported by Chris Blizzard)
* gtk/gtkentry.c (entry_adjust_scroll): When calculating
things so that the cursor appears on screen, properly
take into account INNER_BORDER.
(Fixes bug #4754, reported by Antonio Campos)
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 11 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 20 | ||||
-rw-r--r-- | gtk/gtkentry.c | 16 |
9 files changed, 106 insertions, 7 deletions
@@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d9e467419..d5caa9c69 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Thu Jan 27 00:15:03 2000 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions): + Finish the job of allowing event to be NULL. + (Fixes bug #4283, reported by Chris Blizzard) + + * gtk/gtkentry.c (entry_adjust_scroll): When calculating + things so that the cursor appears on screen, properly + take into account INNER_BORDER. + (Fixes bug #4754, reported by Antonio Campos) + Wed Jan 26 23:12:28 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_map): Don't diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 60aa20065..041ec9841 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -546,6 +546,17 @@ gtk_drag_get_event_actions (GdkEvent *event, *suggested_action = GDK_ACTION_LINK; } } + else + { + *possible_actions = actions; + + if (actions & GDK_ACTION_COPY) + *suggested_action = GDK_ACTION_COPY; + else if (actions & GDK_ACTION_MOVE) + *suggested_action = GDK_ACTION_MOVE; + else if (actions & GDK_ACTION_LINK) + *suggested_action = GDK_ACTION_LINK; + } return; } @@ -1625,7 +1636,7 @@ gtk_drag_begin (GtkWidget *widget, GList *targets = NULL; GList *tmp_list; guint32 time = GDK_CURRENT_TIME; - GdkDragAction possible_actions, suggested_action; + GdkDragAction possible_actions = suggested_action; g_return_val_if_fail (widget != NULL, NULL); g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL); @@ -1673,13 +1684,12 @@ gtk_drag_begin (GtkWidget *widget, gtk_drag_get_event_actions (event, info->button, actions, &suggested_action, &possible_actions); - if (event) - info->cursor = gtk_drag_get_cursor (suggested_action); + info->cursor = gtk_drag_get_cursor (suggested_action); /* Set cur_x, cur_y here so if the "drag_begin" signal shows * the drag icon, it will be in the right place */ - if (event->type == GDK_MOTION_NOTIFY) + if (event && event->type == GDK_MOTION_NOTIFY) { info->cur_x = event->motion.x_root; info->cur_y = event->motion.y_root; @@ -1696,7 +1706,7 @@ gtk_drag_begin (GtkWidget *widget, gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin", info->context); - if (event->type == GDK_MOTION_NOTIFY) + if (event && event->type == GDK_MOTION_NOTIFY) gtk_drag_motion_cb (info->ipc_widget, (GdkEventMotion *)event, info); info->start_x = info->cur_x; diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 4c2afd99f..6cc62ad2e 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -36,6 +36,8 @@ #define MIN_ENTRY_WIDTH 150 #define DRAW_TIMEOUT 20 + +/* If you are going to change this, see the note in entry_adjust_scroll */ #define INNER_BORDER 2 enum { @@ -1588,6 +1590,7 @@ entry_adjust_scroll (GtkEntry *entry) return; gdk_window_get_size (entry->text_area, &text_area_width, NULL); + text_area_width -= 2 * INNER_BORDER; /* Display as much text as we can */ max_offset = MAX(0, entry->char_offset[entry->text_length] - text_area_width); @@ -1595,14 +1598,23 @@ entry_adjust_scroll (GtkEntry *entry) if (entry->scroll_offset > max_offset) entry->scroll_offset = max_offset; - /* And make sure cursor is on screen */ + /* And make sure cursor is on screen. Note that the cursor is + * actually drawn one pixel into the INNER_BORDER space on + * the right, when the scroll is at the utmost right. This + * looks better to to me than confining the cursor inside the + * border entirely, though it means that the cursor gets one + * pixel closer to the the edge of the widget on the right than + * on the left. This might need changing if one changed + * INNER_BORDER from 2 to 1, as one would do on a + * small-screen-real-estate display. + */ xoffset = entry->char_offset[GTK_EDITABLE(entry)->current_pos]; xoffset -= entry->scroll_offset; if (xoffset < 0) entry->scroll_offset += xoffset; else if (xoffset > text_area_width) - entry->scroll_offset += xoffset - text_area_width + 1; + entry->scroll_offset += xoffset - text_area_width; gtk_widget_queue_draw (GTK_WIDGET (entry)); } |