[gtk+/wip/mir2] Revert "mir: create special menu surfaces"
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/mir2] Revert "mir: create special menu surfaces"
- Date: Tue, 3 Feb 2015 15:24:50 +0000 (UTC)
commit e24b63e0ec31c777f4d5009247a840f71f8e844e
Author: William Hua <william attente ca>
Date: Tue Feb 3 15:42:57 2015 +0100
Revert "mir: create special menu surfaces"
This reverts commit 9aaef4e4bcdbaa007bc1731229adeea8eb2d956b.
gdk/mir/gdkmirwindowimpl.c | 82 ++-----------------------------------------
1 files changed, 4 insertions(+), 78 deletions(-)
---
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 107084f..5ecec56 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -200,48 +200,6 @@ create_mir_surface (GdkDisplay *display,
}
static void
-ensure_surface (GdkWindow *window);
-
-static MirSurface *
-create_mir_menu_surface (GdkDisplay *display,
- gint x,
- gint y,
- gint width,
- gint height,
- GdkWindow *parent,
- MirBufferUsage buffer_usage)
-{
- MirSurfaceSpec *spec;
- MirConnection *connection;
- MirPixelFormat format;
- MirRectangle rect;
- MirSurface *surface;
- GdkMirWindowImpl *parent_impl;
-
- connection = gdk_mir_display_get_mir_connection (display);
- format = _gdk_mir_display_get_pixel_format (display, buffer_usage);
- parent_impl = parent ? GDK_MIR_WINDOW_IMPL (parent->impl) : NULL;
- if (parent_impl)
- ensure_surface (parent);
- rect.left = x;
- rect.top = y;
- rect.width = 0;
- rect.height = 0;
- spec = mir_connection_create_spec_for_menu_surface (connection,
- width,
- height,
- format,
- parent_impl ? parent_impl->surface : NULL,
- &rect,
- mir_edge_attachment_horizontal);
- mir_surface_spec_set_buffer_usage (spec, buffer_usage);
- surface = mir_surface_create_sync (spec);
- mir_surface_spec_release (spec);
-
- return surface;
-}
-
-static void
ensure_surface_full (GdkWindow *window,
MirBufferUsage buffer_usage)
{
@@ -259,24 +217,9 @@ ensure_surface_full (GdkWindow *window,
event_delegate.context = window_ref;
- switch (gdk_window_get_type_hint (window))
- {
- case GDK_WINDOW_TYPE_HINT_MENU:
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
- impl->surface = create_mir_menu_surface (gdk_window_get_display (window),
- impl->transient_x, impl->transient_y,
- window->width, window->height,
- gdk_window_get_parent (window),
- buffer_usage);
- break;
- default:
- impl->surface = create_mir_surface (gdk_window_get_display (window),
- window->width, window->height,
- buffer_usage);
- break;
- }
+ impl->surface = create_mir_surface (gdk_window_get_display (window),
+ window->width, window->height,
+ buffer_usage);
MirEvent resize_event;
@@ -352,24 +295,7 @@ should_render_in_parent (GdkWindow *window)
{
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
- if (!impl->transient_for)
- return FALSE;
-
- if (gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL)
- return FALSE;
-
- switch (gdk_window_get_type_hint (window))
- {
- case GDK_WINDOW_TYPE_HINT_MENU:
- case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
- case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
- case GDK_WINDOW_TYPE_HINT_COMBO:
- return FALSE;
- default:
- break;
- }
-
- return TRUE;
+ return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]