mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
Convert all references to GdkEvent->surface
This commit is contained in:
parent
19ca2789c0
commit
4ac450b324
@ -43,7 +43,7 @@ GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
|
||||
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
|
||||
GtkWidget::focus_out_event
|
||||
|
||||
Events that are assured to have a valid GdkEvent.any.window field are
|
||||
Events that are assured to have a valid GdkEvent.any.surface field are
|
||||
|
||||
GDK_EXPOSE GtkWidget::expose_event
|
||||
|
||||
|
@ -117,7 +117,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_ENTER_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->crossing.time = message->base.time;
|
||||
event->crossing.x = message->pointer.win_x;
|
||||
event->crossing.y = message->pointer.win_y;
|
||||
@ -137,7 +137,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_LEAVE_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->crossing.time = message->base.time;
|
||||
event->crossing.x = message->pointer.win_x;
|
||||
event->crossing.y = message->pointer.win_y;
|
||||
@ -160,7 +160,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->motion.time = message->base.time;
|
||||
event->motion.x = message->pointer.win_x;
|
||||
event->motion.y = message->pointer.win_y;
|
||||
@ -184,7 +184,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (message->base.type == 'b' ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->button.time = message->base.time;
|
||||
event->button.x = message->pointer.win_x;
|
||||
event->button.y = message->pointer.win_y;
|
||||
@ -204,7 +204,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_SCROLL);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->scroll.time = message->base.time;
|
||||
event->scroll.x = message->pointer.win_x;
|
||||
event->scroll.y = message->pointer.win_y;
|
||||
@ -243,7 +243,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
|
||||
event = gdk_event_new (event_type);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->touch.sequence = GUINT_TO_POINTER(message->touch.sequence_id);
|
||||
event->touch.emulating_pointer = message->touch.is_emulated;
|
||||
event->touch.time = message->base.time;
|
||||
@ -279,7 +279,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (message->base.type == 'k' ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->key.time = message->base.time;
|
||||
event->key.keyval = message->key.key;
|
||||
event->key.state = message->key.state;
|
||||
@ -306,7 +306,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
window->y = message->configure_notify.y;
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->configure.x = message->configure_notify.x;
|
||||
event->configure.y = message->configure_notify.y;
|
||||
event->configure.width = message->configure_notify.width;
|
||||
@ -340,7 +340,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->focus_change.in = FALSE;
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
@ -350,7 +350,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
if (window)
|
||||
{
|
||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->focus_change.in = TRUE;
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
event = gdk_event_new (GDK_DELETE);
|
||||
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
event->any.send_event = FALSE;
|
||||
|
||||
_gdk_event_queue_append (gdk_display_get_default (), event);
|
||||
|
@ -146,8 +146,8 @@ _gdk_quartz_events_break_all_grabs (guint32 time)
|
||||
static void
|
||||
fixup_event (GdkEvent *event)
|
||||
{
|
||||
if (event->any.window)
|
||||
g_object_ref (event->any.window);
|
||||
if (event->any.surface)
|
||||
g_object_ref (event->any.surface);
|
||||
if (((event->any.type == GDK_ENTER_NOTIFY) ||
|
||||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
|
||||
(event->crossing.child_window != NULL))
|
||||
@ -515,7 +515,7 @@ generate_motion_event (GdkSurface *window)
|
||||
GdkQuartzDeviceManagerCore *device_manager;
|
||||
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->any.window = NULL;
|
||||
event->any.surface = NULL;
|
||||
event->any.send_event = TRUE;
|
||||
|
||||
screen_point = [NSEvent mouseLocation];
|
||||
@ -598,7 +598,7 @@ _gdk_quartz_events_send_map_event (GdkSurface *window)
|
||||
GdkEvent event;
|
||||
|
||||
event.any.type = GDK_MAP;
|
||||
event.any.window = window;
|
||||
event.any.surface = window;
|
||||
|
||||
gdk_event_put (&event);
|
||||
}
|
||||
@ -1680,8 +1680,8 @@ gdk_event_translate (GdkEvent *event,
|
||||
done:
|
||||
if (return_val)
|
||||
{
|
||||
if (event->any.window)
|
||||
g_object_ref (event->any.window);
|
||||
if (event->any.surface)
|
||||
g_object_ref (event->any.surface);
|
||||
if (((event->any.type == GDK_ENTER_NOTIFY) ||
|
||||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
|
||||
(event->crossing.child_window != NULL))
|
||||
@ -1690,7 +1690,7 @@ gdk_event_translate (GdkEvent *event,
|
||||
else
|
||||
{
|
||||
/* Mark this event as having no resources to be freed */
|
||||
event->any.window = NULL;
|
||||
event->any.surface = NULL;
|
||||
event->any.type = GDK_NOTHING;
|
||||
}
|
||||
|
||||
@ -1710,7 +1710,7 @@ _gdk_quartz_display_queue_events (GdkDisplay *display)
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
|
||||
event->any.window = NULL;
|
||||
event->any.surface = NULL;
|
||||
event->any.send_event = FALSE;
|
||||
|
||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||
|
@ -898,7 +898,7 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
*/
|
||||
static guint button_map[8] = {0, 1, 4, 5, 2, 3, 6, 7};
|
||||
|
||||
if (event->any.window != wintab_window)
|
||||
if (event->any.surface != wintab_window)
|
||||
{
|
||||
g_warning ("gdk_input_other_event: not wintab_window?");
|
||||
return FALSE;
|
||||
@ -1084,7 +1084,7 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
GDK_SURFACE_HWND (window), x, y));
|
||||
}
|
||||
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
key_state = get_modifier_key_state ();
|
||||
if (event->any.type == GDK_BUTTON_PRESS ||
|
||||
event->any.type == GDK_BUTTON_RELEASE)
|
||||
|
@ -1669,10 +1669,10 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("WM_DROPFILES: %p\n", msg->hwnd));
|
||||
|
||||
context = gdk_drag_context_new (gdk_surface_get_display (event->any.window),
|
||||
context = gdk_drag_context_new (gdk_surface_get_display (event->any.surface),
|
||||
FALSE,
|
||||
NULL,
|
||||
event->any.window,
|
||||
event->any.surface,
|
||||
GDK_ACTION_COPY,
|
||||
NULL,
|
||||
GDK_DRAG_PROTO_WIN32_DROPFILES);
|
||||
|
@ -804,7 +804,7 @@ _gdk_win32_print_event (const GdkEvent *event)
|
||||
}
|
||||
|
||||
g_print (" %p @ %ums ",
|
||||
event->any.window ? GDK_SURFACE_HWND (event->any.window) : NULL,
|
||||
event->any.surface ? GDK_SURFACE_HWND (event->any.surface) : NULL,
|
||||
gdk_event_get_time (event));
|
||||
|
||||
switch (event->any.type)
|
||||
@ -945,8 +945,8 @@ decode_key_lparam (LPARAM lParam)
|
||||
static void
|
||||
fixup_event (GdkEvent *event)
|
||||
{
|
||||
if (event->any.window)
|
||||
g_object_ref (event->any.window);
|
||||
if (event->any.surface)
|
||||
g_object_ref (event->any.surface);
|
||||
if (((event->any.type == GDK_ENTER_NOTIFY) ||
|
||||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
|
||||
(event->crossing.child_window != NULL))
|
||||
@ -1058,7 +1058,7 @@ apply_event_filters (GdkSurface *window,
|
||||
GList *tmp_list;
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
event->any.window = g_object_ref (window);
|
||||
event->any.surface = g_object_ref (window);
|
||||
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
@ -3368,7 +3368,7 @@ gdk_event_translate (MSG *msg,
|
||||
!GDK_SURFACE_DESTROYED (window))
|
||||
{
|
||||
event = gdk_event_new (GDK_MAP);
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
|
||||
@ -3432,7 +3432,7 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
/* Send UNMAP events */
|
||||
event = gdk_event_new (GDK_UNMAP);
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
/* Make transient parent the forground window when window unmaps */
|
||||
@ -3705,7 +3705,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
|
||||
event = gdk_event_new (GDK_DELETE);
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@ -3740,7 +3740,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
|
||||
event = gdk_event_new (GDK_DESTROY);
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@ -3935,7 +3935,7 @@ gdk_event_translate (MSG *msg,
|
||||
wintab:
|
||||
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
event->any.window = window;
|
||||
event->any.surface = window;
|
||||
g_object_ref (window);
|
||||
|
||||
if (gdk_input_other_event (display, event, msg, window))
|
||||
|
@ -1139,7 +1139,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
|
||||
* toplevel GdkSurface, which should be the GdkSurface backing
|
||||
* nswindow. Then, we convert to the NSWindow coordinate system.
|
||||
*/
|
||||
window = event->any.window;
|
||||
window = event->any.surface;
|
||||
GdkSurface *toplevel = gdk_surface_get_toplevel (window);
|
||||
|
||||
while (window != toplevel)
|
||||
|
@ -157,7 +157,7 @@ invalidate_win32_themes (GdkXEvent *xevent,
|
||||
gpointer theme;
|
||||
MSG *msg;
|
||||
|
||||
if (!GDK_IS_WIN32_SURFACE (event->any.window))
|
||||
if (!GDK_IS_WIN32_SURFACE (event->any.surface))
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
msg = (MSG *) xevent;
|
||||
@ -170,7 +170,7 @@ invalidate_win32_themes (GdkXEvent *xevent,
|
||||
theme_was_open |= gtk_win32_theme_close (theme);
|
||||
}
|
||||
if (theme_was_open)
|
||||
gtk_style_context_reset_widgets (gdk_surface_get_display (event->any.window));
|
||||
gtk_style_context_reset_widgets (gdk_surface_get_display (event->any.surface));
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user