[gtk/global-coords: 30/37] window: Never call gdk_surface_move
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/global-coords: 30/37] window: Never call gdk_surface_move
- Date: Wed, 29 May 2019 18:06:17 +0000 (UTC)
commit 74db7cbe00bdb57e5049ccb7cec442eed661060e
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 29 15:12:34 2019 +0000
window: Never call gdk_surface_move
With gtk_window_set_position gone, we should never
come up with a new position to set in this code.
Leave a warning in place and remove the gdk_surface_move
calls.
gtk/gtkwindow.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 9cf6c83d97..e1d51e245e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6922,7 +6922,7 @@ gtk_window_move_resize (GtkWindow *window)
hints_changed = FALSE;
gtk_window_compute_configure_request (window, &new_request,
- &new_geometry, &new_flags);
+ &new_geometry, &new_flags);
/* This check implies the invariant that we never set info->last
* without setting the hints and sending off a configure request.
@@ -6986,13 +6986,13 @@ gtk_window_move_resize (GtkWindow *window)
info->last.geometry = new_geometry;
info->last.flags = new_flags;
info->last.configure_request = new_request;
-
+
/* need to set PPosition so the WM will look at our position,
* but we don't want to count PPosition coming and going as a hints
* change for future iterations. So we saved info->last prior to
* this.
*/
-
+
/* Also, if the initial position was explicitly set, then we always
* toggle on PPosition. This makes gtk_window_move(window, 0, 0)
* work.
@@ -7003,7 +7003,7 @@ gtk_window_move_resize (GtkWindow *window)
new_flags |= GDK_HINT_POS;
hints_changed = TRUE;
}
-
+
/* Set hints if necessary
*/
if (hints_changed)
@@ -7135,16 +7135,10 @@ gtk_window_move_resize (GtkWindow *window)
/* Now send the configure request */
if (configure_request_pos_changed)
- {
- gdk_surface_move_resize (priv->surface,
- new_request.x, new_request.y,
- new_request.width, new_request.height);
- }
- else /* only size changed */
- {
- gdk_surface_resize (priv->surface,
- new_request.width, new_request.height);
- }
+ g_warning ("configure request position changed. This should not happen. Ignoring the position");
+
+ gdk_surface_resize (priv->surface,
+ new_request.width, new_request.height);
if (priv->type == GTK_WINDOW_POPUP)
{
@@ -7167,10 +7161,7 @@ gtk_window_move_resize (GtkWindow *window)
/* Handle any position changes.
*/
if (configure_request_pos_changed)
- {
- gdk_surface_move (priv->surface,
- new_request.x, new_request.y);
- }
+ g_warning ("configure request position changed. This should not happen. Ignoring the position");
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, current_height,
&min_width, NULL, NULL, NULL);
@@ -7187,7 +7178,7 @@ gtk_window_move_resize (GtkWindow *window)
gtk_widget_size_allocate (widget, &allocation, -1);
}
-
+
/* We have now processed a move/resize since the last position
* constraint change, setting of the initial position, or resize.
* (Not resetting these flags here can lead to infinite loops for
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]