[gtk+/wip/attachment-parameters: 6/23] gdkwindow-broadway: move window on map
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/attachment-parameters: 6/23] gdkwindow-broadway: move window on map
- Date: Thu, 1 Oct 2015 14:11:13 +0000 (UTC)
commit bb4cdebdddfe51dbe4ac9ad58d4deaadcc2fa86b
Author: William Hua <william hua canonical com>
Date: Tue Sep 29 13:31:57 2015 -0400
gdkwindow-broadway: move window on map
Broadway doesn't seem to allow us to move the window before it's mapped.
This means we must wait for the window to appear, then move the window.
gdk/broadway/gdkwindow-broadway.c | 17 ++++++++++++++++-
gdk/broadway/gdkwindow-broadway.h | 3 +++
2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 60be8aa..f136cb7 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -434,6 +434,12 @@ gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped)
if (_gdk_broadway_server_window_show (broadway_display->server, impl->id))
queue_flush (window);
+ if (impl->move_on_map)
+ {
+ impl->move_on_map = FALSE;
+
+ gdk_window_move (window, impl->initial_position.x, impl->initial_position.y);
+ }
}
static void
@@ -1549,6 +1555,7 @@ static void
gdk_broadway_window_set_attachment_parameters (GdkWindow *window,
const GdkAttachmentParameters *parameters)
{
+ GdkWindowImplBroadway *impl;
GdkPoint position;
GdkPoint offset;
GdkAttachmentOption primary_option;
@@ -1564,7 +1571,15 @@ gdk_broadway_window_set_attachment_parameters (GdkWindow *wi
&primary_option,
&secondary_option))
{
- gdk_window_move (window, position.x, position.y);
+ impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+
+ if (!impl->visible)
+ {
+ impl->move_on_map = TRUE;
+ impl->initial_position = position;
+ }
+ else
+ gdk_window_move (window, position.x, position.y);
if (parameters->position_callback)
parameters->position_callback (window,
diff --git a/gdk/broadway/gdkwindow-broadway.h b/gdk/broadway/gdkwindow-broadway.h
index f6a9ec1..47f67ca 100644
--- a/gdk/broadway/gdkwindow-broadway.h
+++ b/gdk/broadway/gdkwindow-broadway.h
@@ -73,6 +73,9 @@ struct _GdkWindowImplBroadway
GdkGeometry geometry_hints;
GdkWindowHints geometry_hints_mask;
+
+ guint move_on_map : 1;
+ GdkPoint initial_position;
};
struct _GdkWindowImplBroadwayClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]