forked from AuroraMiddleware/gtk
gdk: Drop input-only surfaces
We are not creating such surfaces anymore, and they were only ever meaningfully implemented on X11. Drop the concept, and the api for determining if a surface is input-only.
This commit is contained in:
parent
1a23ebf105
commit
2855729cb4
@ -190,7 +190,6 @@ gdk_surface_hide
|
||||
gdk_surface_is_destroyed
|
||||
gdk_surface_is_visible
|
||||
gdk_surface_is_viewable
|
||||
gdk_surface_is_input_only
|
||||
gdk_surface_get_state
|
||||
gdk_surface_iconify
|
||||
gdk_surface_deiconify
|
||||
|
@ -160,7 +160,6 @@ struct _GdkSurface
|
||||
guint8 alpha;
|
||||
guint8 fullscreen_mode;
|
||||
|
||||
guint input_only : 1;
|
||||
guint pass_through : 1;
|
||||
guint modal_hint : 1;
|
||||
|
||||
|
@ -475,7 +475,6 @@ _gdk_surface_update_size (GdkSurface *surface)
|
||||
|
||||
static GdkSurface *
|
||||
gdk_surface_new (GdkDisplay *display,
|
||||
gboolean input_only,
|
||||
GdkSurfaceType surface_type,
|
||||
int x,
|
||||
int y,
|
||||
@ -496,11 +495,8 @@ gdk_surface_new (GdkDisplay *display,
|
||||
surface->y = y;
|
||||
surface->width = width;
|
||||
surface->height = height;
|
||||
surface->input_only = input_only;
|
||||
surface->surface_type = surface_type;
|
||||
|
||||
g_warn_if_fail (!surface->input_only || surface->surface_type == GDK_SURFACE_TEMP);
|
||||
|
||||
frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL);
|
||||
gdk_surface_set_frame_clock (surface, frame_clock);
|
||||
g_object_unref (frame_clock);
|
||||
@ -536,7 +532,7 @@ gdk_surface_new_toplevel (GdkDisplay *display,
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return gdk_surface_new (display, FALSE, GDK_SURFACE_TOPLEVEL, 0, 0, width, height);
|
||||
return gdk_surface_new (display, GDK_SURFACE_TOPLEVEL, 0, 0, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -556,7 +552,7 @@ gdk_surface_new_popup (GdkDisplay *display,
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (position != NULL, NULL);
|
||||
|
||||
return gdk_surface_new (display, FALSE, GDK_SURFACE_TEMP,
|
||||
return gdk_surface_new (display, GDK_SURFACE_TEMP,
|
||||
position->x, position->y,
|
||||
position->width, position->height);
|
||||
}
|
||||
@ -582,7 +578,7 @@ gdk_surface_new_popup_full (GdkDisplay *display,
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
|
||||
|
||||
surface = gdk_surface_new (display, FALSE, GDK_SURFACE_TEMP, 0, 0, 100, 100);
|
||||
surface = gdk_surface_new (display, GDK_SURFACE_TEMP, 0, 0, 100, 100);
|
||||
gdk_surface_set_transient_for (surface, parent);
|
||||
gdk_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_MENU);
|
||||
|
||||
@ -1154,7 +1150,7 @@ gdk_surface_invalidate_rect (GdkSurface *surface,
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (surface->input_only || !surface->viewable)
|
||||
if (!surface->viewable)
|
||||
return;
|
||||
|
||||
if (!rect)
|
||||
@ -1233,9 +1229,7 @@ gdk_surface_invalidate_region (GdkSurface *surface,
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (surface->input_only ||
|
||||
!surface->viewable ||
|
||||
cairo_region_is_empty (region))
|
||||
if (!surface->viewable || cairo_region_is_empty (region))
|
||||
return;
|
||||
|
||||
r.x = 0;
|
||||
@ -2452,22 +2446,6 @@ gdk_surface_get_focus_on_map (GdkSurface *surface)
|
||||
return surface->focus_on_map;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_surface_is_input_only:
|
||||
* @surface: a toplevel #GdkSurface
|
||||
*
|
||||
* Determines whether or not the surface is an input only surface.
|
||||
*
|
||||
* Returns: %TRUE if @surface is input only
|
||||
*/
|
||||
gboolean
|
||||
gdk_surface_is_input_only (GdkSurface *surface)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
||||
|
||||
return surface->input_only;
|
||||
}
|
||||
|
||||
static void
|
||||
update_cursor (GdkDisplay *display,
|
||||
GdkDevice *device)
|
||||
@ -2634,9 +2612,6 @@ gdk_surface_print (GdkSurface *surface,
|
||||
|
||||
g_print (" %s", surface_types[surface->surface_type]);
|
||||
|
||||
if (surface->input_only)
|
||||
g_print (" input-only");
|
||||
|
||||
if (!gdk_surface_is_visible ((GdkSurface *)surface))
|
||||
g_print (" hidden");
|
||||
|
||||
@ -2653,18 +2628,14 @@ gdk_surface_print (GdkSurface *surface,
|
||||
|
||||
static void
|
||||
gdk_surface_print_tree (GdkSurface *surface,
|
||||
int indent,
|
||||
gboolean include_input_only)
|
||||
int indent)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
if (surface->input_only && !include_input_only)
|
||||
return;
|
||||
|
||||
gdk_surface_print (surface, indent);
|
||||
|
||||
for (l = surface->children; l != NULL; l = l->next)
|
||||
gdk_surface_print_tree (l->data, indent + 4, include_input_only);
|
||||
gdk_surface_print_tree (l->data, indent + 4);
|
||||
}
|
||||
|
||||
#endif /* DEBUG_SURFACE_PRINTING */
|
||||
@ -2722,7 +2693,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
|
||||
(event->key.keyval == 0xa7 ||
|
||||
event->key.keyval == 0xbd))
|
||||
{
|
||||
gdk_surface_print_tree (event_surface, 0, event->key.keyval == 0xbd);
|
||||
gdk_surface_print_tree (event_surface, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -528,8 +528,6 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_visible (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_viewable (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_surface_is_input_only (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
|
||||
|
@ -1138,8 +1138,6 @@ move_resize_window_internal (GdkSurface *window,
|
||||
[impl->toplevel setFrame:frame_rect display:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!window->input_only)
|
||||
{
|
||||
NSRect nsrect;
|
||||
|
||||
@ -1189,7 +1187,6 @@ move_resize_window_internal (GdkSurface *window,
|
||||
cairo_region_destroy (expose_region);
|
||||
cairo_region_destroy (old_region);
|
||||
}
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ _gdk_win32_surface_tmp_unset_bg (GdkSurface *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_SURFACE (window));
|
||||
|
||||
if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
|
||||
if (window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
|
||||
return;
|
||||
|
||||
tmp_unset_bg (window);
|
||||
@ -157,7 +157,7 @@ _gdk_win32_surface_tmp_reset_bg (GdkSurface *window,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_SURFACE (window));
|
||||
|
||||
if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
|
||||
if (window->destroyed || !GDK_SURFACE_IS_MAPPED (window))
|
||||
return;
|
||||
|
||||
tmp_reset_bg (window);
|
||||
|
@ -568,19 +568,7 @@ _gdk_win32_display_create_surface_impl (GdkDisplay *display,
|
||||
impl->unscaled_width = window->width * impl->surface_scale;
|
||||
impl->unscaled_height = window->height * impl->surface_scale;
|
||||
|
||||
if (!window->input_only)
|
||||
{
|
||||
dwExStyle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* I very much doubt using WS_EX_TRANSPARENT actually
|
||||
* corresponds to how X11 InputOnly windows work, but it appears
|
||||
* to work well enough for the actual use cases in gtk.
|
||||
*/
|
||||
dwExStyle = WS_EX_TRANSPARENT;
|
||||
GDK_NOTE (MISC, g_print ("... GDK_INPUT_ONLY\n"));
|
||||
}
|
||||
|
||||
switch (window->surface_type)
|
||||
{
|
||||
|
@ -717,8 +717,6 @@ setup_toplevel_window (GdkSurface *surface,
|
||||
|
||||
set_wm_protocols (surface);
|
||||
|
||||
if (!surface->input_only)
|
||||
{
|
||||
/* The focus surface is off the visible area, and serves to receive key
|
||||
* press events so they don't get sent to child surfaces.
|
||||
*/
|
||||
@ -726,7 +724,6 @@ setup_toplevel_window (GdkSurface *surface,
|
||||
_gdk_x11_display_add_window (x11_screen->display,
|
||||
&toplevel->focus_window,
|
||||
surface);
|
||||
}
|
||||
|
||||
check_leader_window_title (x11_screen->display);
|
||||
|
||||
@ -858,8 +855,6 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
|
||||
|
||||
impl->override_redirect = FALSE;
|
||||
|
||||
if (!surface->input_only)
|
||||
{
|
||||
class = InputOutput;
|
||||
|
||||
xattributes.background_pixmap = None;
|
||||
@ -885,21 +880,6 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
|
||||
}
|
||||
|
||||
depth = gdk_x11_display_get_window_depth (display_x11);
|
||||
}
|
||||
else
|
||||
{
|
||||
class = InputOnly;
|
||||
|
||||
if (surface->surface_type == GDK_SURFACE_TEMP)
|
||||
{
|
||||
xattributes.override_redirect = True;
|
||||
xattributes_mask |= CWOverrideRedirect;
|
||||
|
||||
impl->override_redirect = TRUE;
|
||||
}
|
||||
|
||||
depth = 0;
|
||||
}
|
||||
|
||||
if (surface->width * impl->surface_scale > 32767 ||
|
||||
surface->height * impl->surface_scale > 32767)
|
||||
|
Loading…
Reference in New Issue
Block a user