[gtk/present-toplevel-2: 151/178] surface: Drop unused wm decoration vfuncs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 151/178] surface: Drop unused wm decoration vfuncs
- Date: Tue, 10 Mar 2020 01:22:37 +0000 (UTC)
commit 997fdea736bff6874a002d594abff321bbdd3351
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Mar 9 10:14:37 2020 -0700
surface: Drop unused wm decoration vfuncs
gdk/broadway/gdksurface-broadway.c | 34 -----------
gdk/quartz/gdksurface-quartz.c | 56 +-----------------
gdk/wayland/gdksurface-wayland.c | 22 -------
gdk/win32/gdksurface-win32.c | 118 -------------------------------------
gdk/x11/gdksurface-x11.c | 3 -
5 files changed, 3 insertions(+), 230 deletions(-)
---
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index d8219e4a3b..a7c1068873 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -870,37 +870,6 @@ gdk_broadway_surface_set_keep_below (GdkSurface *surface, gboolean setting)
}
-static void
-gdk_broadway_surface_set_decorations (GdkSurface *surface,
- GdkWMDecoration decorations)
-{
- if (GDK_SURFACE_DESTROYED (surface))
- return;
-
-}
-
-static gboolean
-gdk_broadway_surface_get_decorations (GdkSurface *surface,
- GdkWMDecoration *decorations)
-{
- gboolean result = FALSE;
-
- if (GDK_SURFACE_DESTROYED (surface))
- return FALSE;
-
- return result;
-}
-
-static void
-gdk_broadway_surface_set_functions (GdkSurface *surface,
- GdkWMFunction functions)
-{
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
- if (GDK_SURFACE_DESTROYED (surface))
- return;
-}
-
void
gdk_broadway_surface_update_popups (GdkSurface *parent)
{
@@ -1440,9 +1409,6 @@ gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass)
impl_class->unfullscreen = gdk_broadway_surface_unfullscreen;
impl_class->set_keep_above = gdk_broadway_surface_set_keep_above;
impl_class->set_keep_below = gdk_broadway_surface_set_keep_below;
- impl_class->set_decorations = gdk_broadway_surface_set_decorations;
- impl_class->get_decorations = gdk_broadway_surface_get_decorations;
- impl_class->set_functions = gdk_broadway_surface_set_functions;
impl_class->begin_resize_drag = gdk_broadway_surface_begin_resize_drag;
impl_class->begin_move_drag = gdk_broadway_surface_begin_move_drag;
impl_class->set_opacity = gdk_broadway_surface_set_opacity;
diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c
index 24cf0d39d2..d16d26f224 100644
--- a/gdk/quartz/gdksurface-quartz.c
+++ b/gdk/quartz/gdksurface-quartz.c
@@ -2247,53 +2247,6 @@ gdk_quartz_surface_get_decorations (GdkSurface *window,
return TRUE;
}
-static void
-gdk_quartz_surface_set_functions (GdkSurface *window,
- GdkWMFunction functions)
-{
- GdkSurfaceImplQuartz *impl;
- gboolean min, max, close;
-
- g_return_if_fail (GDK_IS_SURFACE (window));
-
- impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
-
- if (functions & GDK_FUNC_ALL)
- {
- min = !(functions & GDK_FUNC_MINIMIZE);
- max = !(functions & GDK_FUNC_MAXIMIZE);
- close = !(functions & GDK_FUNC_CLOSE);
- }
- else
- {
- min = (functions & GDK_FUNC_MINIMIZE);
- max = (functions & GDK_FUNC_MAXIMIZE);
- close = (functions & GDK_FUNC_CLOSE);
- }
-
- if (impl->toplevel)
- {
- NSUInteger mask = [impl->toplevel styleMask];
-
- if (min)
- mask = mask | NSMiniaturizableWindowMask;
- else
- mask = mask & ~NSMiniaturizableWindowMask;
-
- if (max)
- mask = mask | NSResizableWindowMask;
- else
- mask = mask & ~NSResizableWindowMask;
-
- if (close)
- mask = mask | NSClosableWindowMask;
- else
- mask = mask & ~NSClosableWindowMask;
-
- [impl->toplevel setStyleMask:mask];
- }
-}
-
static void
gdk_quartz_surface_stick (GdkSurface *window)
{
@@ -2497,14 +2450,14 @@ gdk_quartz_surface_fullscreen (GdkSurface *window)
geometry->width = window->width;
geometry->height = window->height;
- if (!gdk_surface_get_decorations (window, &geometry->decor))
+ if (!gdk_quartz_surface_get_decorations (window, &geometry->decor))
geometry->decor = GDK_DECOR_ALL;
g_object_set_data_full (G_OBJECT (window),
FULLSCREEN_DATA, geometry,
g_free);
- gdk_surface_set_decorations (window, 0);
+ gdk_quartz_surface_set_decorations (window, 0);
frame = [[impl->toplevel screen] frame];
move_resize_window_internal (window,
@@ -2542,7 +2495,7 @@ gdk_quartz_surface_unfullscreen (GdkSurface *window)
geometry->width,
geometry->height);
- gdk_surface_set_decorations (window, geometry->decor);
+ gdk_quartz_surface_set_decorations (window, geometry->decor);
g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL);
@@ -2711,9 +2664,6 @@ gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass)
impl_class->unfullscreen = gdk_quartz_surface_unfullscreen;
impl_class->set_keep_above = gdk_quartz_surface_set_keep_above;
impl_class->set_keep_below = gdk_quartz_surface_set_keep_below;
- impl_class->set_decorations = gdk_quartz_surface_set_decorations;
- impl_class->get_decorations = gdk_quartz_surface_get_decorations;
- impl_class->set_functions = gdk_quartz_surface_set_functions;
impl_class->begin_resize_drag = gdk_quartz_surface_begin_resize_drag;
impl_class->begin_move_drag = gdk_quartz_surface_begin_move_drag;
impl_class->set_opacity = gdk_quartz_surface_set_opacity;
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 3452e53c8e..3540e26ed1 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -3526,25 +3526,6 @@ gdk_wayland_surface_set_keep_below (GdkSurface *surface,
{
}
-static void
-gdk_wayland_surface_set_decorations (GdkSurface *surface,
- GdkWMDecoration decorations)
-{
-}
-
-static gboolean
-gdk_wayland_surface_get_decorations (GdkSurface *surface,
- GdkWMDecoration *decorations)
-{
- return FALSE;
-}
-
-static void
-gdk_wayland_surface_set_functions (GdkSurface *surface,
- GdkWMFunction functions)
-{
-}
-
static void
gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
@@ -3864,9 +3845,6 @@ gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *klass)
impl_class->unfullscreen = gdk_wayland_surface_unfullscreen;
impl_class->set_keep_above = gdk_wayland_surface_set_keep_above;
impl_class->set_keep_below = gdk_wayland_surface_set_keep_below;
- impl_class->set_decorations = gdk_wayland_surface_set_decorations;
- impl_class->get_decorations = gdk_wayland_surface_get_decorations;
- impl_class->set_functions = gdk_wayland_surface_set_functions;
impl_class->begin_resize_drag = gdk_wayland_surface_begin_resize_drag;
impl_class->begin_move_drag = gdk_wayland_surface_begin_move_drag;
impl_class->set_opacity = gdk_wayland_surface_set_opacity;
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index aa4388756d..aa1244b775 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -120,8 +120,6 @@ typedef struct _AeroSnapEdgeRegion AeroSnapEdgeRegion;
static void gdk_win32_impl_frame_clock_after_paint (GdkFrameClock *clock,
GdkSurface *surface);
-static gboolean _gdk_surface_get_functions (GdkSurface *window,
- GdkWMFunction *functions);
G_DEFINE_TYPE (GdkWin32Surface, gdk_win32_surface, GDK_TYPE_SURFACE)
@@ -2210,119 +2208,6 @@ update_single_system_menu_entry (HMENU hmenu,
EnableMenuItem (hmenu, menu_entry, MF_BYCOMMAND | MF_GRAYED);
}
-static void
-update_system_menu (GdkSurface *window)
-{
- GdkWMFunction functions;
- BOOL all;
-
- if (_gdk_surface_get_functions (window, &functions))
- {
- HMENU hmenu = GetSystemMenu (GDK_SURFACE_HWND (window), FALSE);
-
- all = (functions & GDK_FUNC_ALL);
- update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_RESIZE, SC_SIZE);
- update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MOVE, SC_MOVE);
- update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MINIMIZE, SC_MINIMIZE);
- update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MAXIMIZE, SC_MAXIMIZE);
- update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_CLOSE, SC_CLOSE);
- }
-}
-
-static void
-gdk_win32_surface_set_decorations (GdkSurface *window,
- GdkWMDecoration decorations)
-{
- GdkWin32Surface *impl;
-
- g_return_if_fail (GDK_IS_SURFACE (window));
-
- impl = GDK_WIN32_SURFACE (window);
-
- GDK_NOTE (MISC, g_print ("gdk_surface_set_decorations: %p: %s %s%s%s%s%s%s\n",
- GDK_SURFACE_HWND (window),
- (decorations & GDK_DECOR_ALL ? "clearing" : "setting"),
- (decorations & GDK_DECOR_BORDER ? "BORDER " : ""),
- (decorations & GDK_DECOR_RESIZEH ? "RESIZEH " : ""),
- (decorations & GDK_DECOR_TITLE ? "TITLE " : ""),
- (decorations & GDK_DECOR_MENU ? "MENU " : ""),
- (decorations & GDK_DECOR_MINIMIZE ? "MINIMIZE " : ""),
- (decorations & GDK_DECOR_MAXIMIZE ? "MAXIMIZE " : "")));
-
- if (!impl->decorations)
- impl->decorations = g_malloc (sizeof (GdkWMDecoration));
-
- *impl->decorations = decorations;
-
- _gdk_win32_surface_update_style_bits (window);
-}
-
-static gboolean
-gdk_win32_surface_get_decorations (GdkSurface *window,
- GdkWMDecoration *decorations)
-{
- GdkWin32Surface *impl;
-
- g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
-
- impl = GDK_WIN32_SURFACE (window);
-
- if (impl->decorations == NULL)
- return FALSE;
-
- *decorations = *impl->decorations;
-
- return TRUE;
-}
-
-static GQuark
-get_functions_quark ()
-{
- static GQuark quark = 0;
-
- if (!quark)
- quark = g_quark_from_static_string ("gdk-surface-functions");
-
- return quark;
-}
-
-static void
-gdk_win32_surface_set_functions (GdkSurface *window,
- GdkWMFunction functions)
-{
- GdkWMFunction* functions_copy;
-
- g_return_if_fail (GDK_IS_SURFACE (window));
-
- GDK_NOTE (MISC, g_print ("gdk_surface_set_functions: %p: %s %s%s%s%s%s\n",
- GDK_SURFACE_HWND (window),
- (functions & GDK_FUNC_ALL ? "clearing" : "setting"),
- (functions & GDK_FUNC_RESIZE ? "RESIZE " : ""),
- (functions & GDK_FUNC_MOVE ? "MOVE " : ""),
- (functions & GDK_FUNC_MINIMIZE ? "MINIMIZE " : ""),
- (functions & GDK_FUNC_MAXIMIZE ? "MAXIMIZE " : ""),
- (functions & GDK_FUNC_CLOSE ? "CLOSE " : "")));
-
- functions_copy = g_malloc (sizeof (GdkWMFunction));
- *functions_copy = functions;
- g_object_set_qdata_full (G_OBJECT (window), get_functions_quark (), functions_copy, g_free);
-
- update_system_menu (window);
-}
-
-gboolean
-_gdk_surface_get_functions (GdkSurface *window,
- GdkWMFunction *functions)
-{
- GdkWMFunction* functions_set;
-
- functions_set = g_object_get_qdata (G_OBJECT (window), get_functions_quark ());
- if (functions_set)
- *functions = *functions_set;
-
- return (functions_set != NULL);
-}
-
#if defined(MORE_AEROSNAP_DEBUGGING)
static void
log_region (gchar *prefix, AeroSnapEdgeRegion *region)
@@ -5187,9 +5072,6 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass)
impl_class->unfullscreen = gdk_win32_surface_unfullscreen;
impl_class->set_keep_above = gdk_win32_surface_set_keep_above;
impl_class->set_keep_below = gdk_win32_surface_set_keep_below;
- impl_class->set_decorations = gdk_win32_surface_set_decorations;
- impl_class->get_decorations = gdk_win32_surface_get_decorations;
- impl_class->set_functions = gdk_win32_surface_set_functions;
impl_class->set_shadow_width = gdk_win32_surface_set_shadow_width;
impl_class->begin_resize_drag = gdk_win32_surface_begin_resize_drag;
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 3c8e3f158f..5f0a4c6438 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4755,9 +4755,6 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass)
impl_class->unfullscreen = gdk_x11_surface_unfullscreen;
impl_class->set_keep_above = gdk_x11_surface_set_keep_above;
impl_class->set_keep_below = gdk_x11_surface_set_keep_below;
- impl_class->set_decorations = gdk_x11_surface_set_decorations;
- impl_class->get_decorations = gdk_x11_surface_get_decorations;
- impl_class->set_functions = gdk_x11_surface_set_functions;
impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag;
impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
impl_class->set_opacity = gdk_x11_surface_set_opacity;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]