summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-02-05 18:40:14 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-02-05 18:40:14 +0000
commiteb437560d35e11836eea5bac750e6f64e98d8632 (patch)
tree1e88a46cbc949580ba4068b7c6d19ffc1e0b7075
parent915f2c5e5991888d8237c1ecee09bda825c20d39 (diff)
downloadgdk-pixbuf-eb437560d35e11836eea5bac750e6f64e98d8632.tar.gz
Adjust saved positions of children when resizing a guffaw_gravity = TRUE
Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_move_resize): Adjust saved positions of children when resizing a guffaw_gravity = TRUE window. * gtk/gtkdnd.c (gtk_drag_highlight): Rework the highlighting so that it is done in callbacks for draw and expose. This should solve problems with multiple highlights for the same GdkWindow. * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where the highlight was being drawn with an incorrect width/height for !NO_WINDOW widgets.
-rw-r--r--ChangeLog27
-rw-r--r--ChangeLog.pre-2-027
-rw-r--r--ChangeLog.pre-2-1027
-rw-r--r--ChangeLog.pre-2-227
-rw-r--r--ChangeLog.pre-2-427
-rw-r--r--ChangeLog.pre-2-627
-rw-r--r--ChangeLog.pre-2-827
-rw-r--r--gdk/gdkwindow.c14
-rw-r--r--gdk/x11/gdkwindow-x11.c14
-rw-r--r--gtk/gtkdnd.c133
10 files changed, 264 insertions, 86 deletions
diff --git a/ChangeLog b/ChangeLog
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index c9b3147e7..ff2bf351d 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,24 @@
+Fri Feb 5 13:23:50 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkwindow.c (gdk_window_move_resize): Adjust
+ saved positions of children when resizing a
+ guffaw_gravity = TRUE window.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Rework the
+ highlighting so that it is done in callbacks for
+ draw and expose. This should solve problems with
+ multiple highlights for the same GdkWindow.
+
+ * gtk/gtkdnd.c (gtk_drag_highlight): Fix bug where
+ the highlight was being drawn with an incorrect
+ width/height for !NO_WINDOW widgets.
+
+Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkrange.c (gtk_range_style_set): Fixes
+ to account for the changed structure of the windows
+ of range widgets.
+
1999-02-05 Owen Taylor <otaylor@gtk.org>
* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
@@ -35,12 +56,6 @@ Tue Feb 2 12:39:42 1999 Owen Taylor <otaylor@redhat.com>
Make it consistent that info->cur_x/y do not include
info->hot_x/y displacement.
-Tue Feb 2 11:06:02 1999 Owen Taylor <otaylor@redhat.com>
-
- * gtk/gtkrange.c (gtk_range_style_set): Fixes
- to account for the changed structure of the windows
- of range widgets.
-
Tue Feb 2 08:59:16 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml: new sections on Layout and
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index c3fd22581..e6695e242 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -852,6 +852,20 @@ gdk_window_move_resize (GdkWindow *window,
{
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
+ if (private->guffaw_gravity)
+ {
+ GList *tmp_list = private->children;
+ while (tmp_list)
+ {
+ GdkWindowPrivate *child_private = tmp_list->data;
+
+ child_private->x -= x - private->x;
+ child_private->y -= y - private->y;
+
+ tmp_list = tmp_list->next;
+ }
+ }
+
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index c3fd22581..e6695e242 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -852,6 +852,20 @@ gdk_window_move_resize (GdkWindow *window,
{
XMoveResizeWindow (private->xdisplay, private->xwindow, x, y, width, height);
+ if (private->guffaw_gravity)
+ {
+ GList *tmp_list = private->children;
+ while (tmp_list)
+ {
+ GdkWindowPrivate *child_private = tmp_list->data;
+
+ child_private->x -= x - private->x;
+ child_private->y -= y - private->y;
+
+ tmp_list = tmp_list->next;
+ }
+ }
+
if (private->window_type == GDK_WINDOW_CHILD)
{
private->x = x;
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 612f1fc26..6e4adfff6 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -155,6 +155,12 @@ static GdkCursor * gtk_drag_get_cursor (GdkDragAction action);
static GtkWidget *gtk_drag_get_ipc_widget (void);
static void gtk_drag_release_ipc_widget (GtkWidget *widget);
+static void gtk_drag_highlight_paint (GtkWidget *widget);
+static gboolean gtk_drag_highlight_expose (GtkWidget *widget,
+ GdkEventExpose *event,
+ gpointer data);
+
+
static GdkAtom gtk_drag_dest_find_target (GtkWidget *widget,
GtkDragDestSite *site,
GdkDragContext *context);
@@ -650,43 +656,85 @@ gtk_drag_finish (GdkDragContext *context,
}
/*************************************************************
- * gtk_drag_highlight:
- * Highlight the given widget in the default manner.
+ * gtk_drag_highlight_paint:
+ * Paint a highlight indicating drag status onto the widget.
* arguments:
* widget:
* results:
*************************************************************/
-void
-gtk_drag_highlight (GtkWidget *widget)
+static void
+gtk_drag_highlight_paint (GtkWidget *widget)
{
- gint x, y;
+ gint x, y, width, height;
g_return_if_fail (widget != NULL);
- if (GTK_WIDGET_NO_WINDOW (widget))
- {
- x = widget->allocation.x;
- y = widget->allocation.y;
- }
- else
+ if (GTK_WIDGET_DRAWABLE (widget))
{
- x = 0;
- y = 0;
+ if (GTK_WIDGET_NO_WINDOW (widget))
+ {
+ x = widget->allocation.x;
+ y = widget->allocation.y;
+ width = widget->allocation.width;
+ height = widget->allocation.height;
+ }
+ else
+ {
+ x = 0;
+ y = 0;
+ gdk_window_get_size (widget->window, &width, &height);
+ }
+
+ gtk_draw_shadow (widget->style, widget->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ x, y, width, height);
+
+ gdk_draw_rectangle (widget->window,
+ widget->style->black_gc,
+ FALSE,
+ x, y, width - 1, height - 1);
}
-
- gtk_draw_shadow (widget->style, widget->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- x, y,
- widget->allocation.width,
- widget->allocation.height);
-
- gdk_draw_rectangle (widget->window,
- widget->style->black_gc,
- FALSE,
- x, y,
- widget->allocation.width - 1,
- widget->allocation.height - 1);
+}
+
+/*************************************************************
+ * gtk_drag_highlight_expose:
+ * Callback for expose_event for highlighted widgets.
+ * arguments:
+ * widget:
+ * event:
+ * data:
+ * results:
+ *************************************************************/
+
+static gboolean
+gtk_drag_highlight_expose (GtkWidget *widget,
+ GdkEventExpose *event,
+ gpointer data)
+{
+ gtk_drag_highlight_paint (widget);
+ return TRUE;
+}
+
+/*************************************************************
+ * gtk_drag_highlight:
+ * Highlight the given widget in the default manner.
+ * arguments:
+ * widget:
+ * results:
+ *************************************************************/
+
+void
+gtk_drag_highlight (GtkWidget *widget)
+{
+ gtk_signal_connect_after (GTK_OBJECT (widget), "draw",
+ GTK_SIGNAL_FUNC (gtk_drag_highlight_expose),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (widget), "expose_event",
+ GTK_SIGNAL_FUNC (gtk_drag_highlight_paint),
+ NULL);
+
+ gtk_widget_queue_draw (widget);
}
/*************************************************************
@@ -700,25 +748,16 @@ gtk_drag_highlight (GtkWidget *widget)
void
gtk_drag_unhighlight (GtkWidget *widget)
{
- gint x, y;
-
g_return_if_fail (widget != NULL);
- if (GTK_WIDGET_NO_WINDOW (widget))
- {
- x = widget->allocation.x;
- y = widget->allocation.y;
- }
- else
- {
- x = 0;
- y = 0;
- }
-
- gdk_window_clear_area_e (widget->window,
- x, y,
- widget->allocation.width,
- widget->allocation.height);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
+ GTK_SIGNAL_FUNC (gtk_drag_highlight_paint),
+ NULL);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
+ GTK_SIGNAL_FUNC (gtk_drag_highlight_expose),
+ NULL);
+
+ gtk_widget_queue_clear (widget);
}
/*************************************************************
@@ -1097,6 +1136,12 @@ gtk_drag_find_widget (GtkWidget *widget,
if (data->found || !GTK_WIDGET_MAPPED (widget))
return;
+ /* Note that in the following code, we only count the
+ * position as being inside a WINDOW widget if it is inside
+ * widget->window; points that are outside of widget->window
+ * but within the allocation are not counted. This is consistent
+ * with the way we highlight drag targets.
+ */
if (!GTK_WIDGET_NO_WINDOW (widget))
{
new_allocation.x = 0;
@@ -1412,7 +1457,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
else
{
/* We need to synthesize a motion event, wait for a status,
- * and, if we get one a good one, do a drop.
+ * and, if we get a good one, do a drop.
*/
GdkEvent *current_event;