summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-28 21:09:04 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-28 21:09:04 +0000
commit3b906a9c8fa438c771d3d430292467482d62ae11 (patch)
tree2a9d4ad70163e48cd03e865b56f265a4699699c0 /gdk
parente9af640cf91485080f64c54540cae154eda40acc (diff)
downloadgtk+-3b906a9c8fa438c771d3d430292467482d62ae11.tar.gz
Initialize private->event_mask from attributes we retrieved for the
Thu Feb 28 14:49:08 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkwindow-x11.c (gdk_window_foreign_new): Initialize private->event_mask from attributes we retrieved for the window.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkwindow-x11.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 21bcc8b0a9..53779c08ce 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -629,6 +629,21 @@ gdk_window_new (GdkWindow *parent,
return window;
}
+static GdkEventMask
+x_event_mask_to_gdk_event_mask (long mask)
+{
+ GdkEventMask event_mask = 0;
+ int i;
+
+ for (i = 0; i < _gdk_nenvent_masks; i++)
+ {
+ if (mask & _gdk_event_mask_table[i])
+ event_mask |= 1 << (i + 1);
+ }
+
+ return event_mask;
+}
+
/**
* gdk_window_foreign_new:
* @anid: a native window handle.
@@ -692,6 +707,8 @@ gdk_window_foreign_new (GdkNativeWindow anid)
private->window_type = GDK_WINDOW_FOREIGN;
private->destroyed = FALSE;
+ private->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
+
if (attrs.map_state == IsUnmapped)
private->state = GDK_WINDOW_STATE_WITHDRAWN;
else
@@ -2448,7 +2465,6 @@ gdk_window_get_events (GdkWindow *window)
{
XWindowAttributes attrs;
GdkEventMask event_mask;
- int i;
g_return_val_if_fail (window != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
@@ -2461,13 +2477,7 @@ gdk_window_get_events (GdkWindow *window)
GDK_WINDOW_XID (window),
&attrs);
- event_mask = 0;
- for (i = 0; i < _gdk_nenvent_masks; i++)
- {
- if (attrs.your_event_mask & _gdk_event_mask_table[i])
- event_mask |= 1 << (i + 1);
- }
-
+ event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask);
GDK_WINDOW_OBJECT (window)->event_mask = event_mask;
return event_mask;