[gtk+/wip/attachment-parameters: 3/21] gdkwindow-x11: implement gdk_x11_window_set_attachment_parameters ()
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/attachment-parameters: 3/21] gdkwindow-x11: implement gdk_x11_window_set_attachment_parameters ()
- Date: Mon, 28 Sep 2015 20:54:49 +0000 (UTC)
commit 192fce4cf99697a991ca02d746182c37be67dd26
Author: William Hua <william hua canonical com>
Date: Mon Sep 21 13:54:01 2015 -0400
gdkwindow-x11: implement gdk_x11_window_set_attachment_parameters ()
gdk/x11/gdkwindow-x11.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index d08cee0..ee8bd80 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -39,6 +39,7 @@
#include "gdkglcontext-x11.h"
#include "gdkprivate-x11.h"
#include "gdk-private.h"
+#include "gdkattachmentparametersprivate.h"
#include <stdlib.h>
#include <stdio.h>
@@ -5682,6 +5683,38 @@ gdk_x11_window_show_window_menu (GdkWindow *window,
}
static void
+gdk_x11_window_set_attachment_parameters (GdkWindow *window,
+ const GdkAttachmentParameters *parameters)
+{
+ GdkPoint position;
+ GdkPoint offset;
+ GdkAttachmentOption primary_option;
+ GdkAttachmentOption secondary_option;
+
+ if (!parameters || !parameters->has_attachment_rectangle)
+ return;
+
+ if (gdk_attachment_parameters_choose_position_for_window (parameters,
+ window,
+ &position,
+ &offset,
+ &primary_option,
+ &secondary_option))
+ {
+ gdk_window_move (window, position.x, position.y);
+
+ if (parameters->position_callback)
+ parameters->position_callback (window,
+ parameters,
+ &position,
+ &offset,
+ primary_option,
+ secondary_option,
+ parameters->position_callback_user_data);
+ }
+}
+
+static void
gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -5771,4 +5804,5 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->create_gl_context = gdk_x11_window_create_gl_context;
impl_class->invalidate_for_new_frame = gdk_x11_window_invalidate_for_new_frame;
impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size;
+ impl_class->set_attachment_parameters = gdk_x11_window_set_attachment_parameters;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]