summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-10-20 14:07:59 +0200
committerMarge Bot <marge-bot@gnome.org>2022-12-01 20:10:52 +0000
commit450be1dc952091c04d9bb832a78c33700e006046 (patch)
tree2cf8b03511f84ba71040f6ad88b3e57fe11e7dcf
parentb891f8a52c54280cbaed1d163eac154b67a3a2be (diff)
downloadmutter-450be1dc952091c04d9bb832a78c33700e006046.tar.gz
x11: Do not fake frame extents if unmanaged window asks for _NET_FRAME_EXTENTS
If the window is not managed, it's weird that it asks for _NET_FRAME_EXTENTS, it's even weirder that mutter replies with a frame border that would only apply if the window were managed. Stop doing the latter, and drop the MetaUI call that calculates borders from the theme settings. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175>
-rw-r--r--src/ui/ui.c41
-rw-r--r--src/ui/ui.h5
-rw-r--r--src/x11/events.c32
3 files changed, 2 insertions, 76 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 2fbaad993..dd52a0c57 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -211,47 +211,6 @@ meta_ui_window_should_not_cause_focus (Display *xdisplay,
return FALSE;
}
-void
-meta_ui_theme_get_frame_borders (MetaUI *ui,
- MetaFrameType type,
- MetaFrameFlags flags,
- MetaFrameBorders *borders)
-{
- GdkDisplay *display;
- GdkScreen *screen;
- int text_height;
- MetaStyleInfo *style_info = NULL;
- PangoContext *context;
- const PangoFontDescription *font_desc;
- PangoFontDescription *free_font_desc = NULL;
-
- display = gdk_x11_lookup_xdisplay (ui->xdisplay);
- screen = gdk_display_get_default_screen (display);
-
- style_info = meta_theme_create_style_info (screen, NULL);
-
- context = gtk_widget_get_pango_context (GTK_WIDGET (ui->frames));
- font_desc = meta_prefs_get_titlebar_font ();
-
- if (!font_desc)
- {
- free_font_desc = meta_style_info_create_font_desc (style_info);
- font_desc = (const PangoFontDescription *) free_font_desc;
- }
-
- text_height = meta_pango_font_desc_get_text_height (font_desc, context);
-
- meta_theme_get_frame_borders (meta_theme_get_default (),
- style_info, type, text_height, flags,
- borders);
-
- if (free_font_desc)
- pango_font_description_free (free_font_desc);
-
- if (style_info != NULL)
- meta_style_info_unref (style_info);
-}
-
gboolean
meta_ui_window_is_widget (MetaUI *ui,
Window xwindow)
diff --git a/src/ui/ui.h b/src/ui/ui.h
index e7a00e4e6..eb5cc9779 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -39,11 +39,6 @@ typedef gboolean (* MetaEventFunc) (XEvent *xevent, gpointer data);
MetaUI *meta_ui_new (MetaX11Display *x11_display);
void meta_ui_free (MetaUI *ui);
-void meta_ui_theme_get_frame_borders (MetaUI *ui,
- MetaFrameType type,
- MetaFrameFlags flags,
- MetaFrameBorders *borders);
-
MetaUIFrame * meta_ui_create_frame (MetaUI *ui,
Display *xdisplay,
MetaWindow *meta_window,
diff --git a/src/x11/events.c b/src/x11/events.c
index 639b3f580..6b3dee7c5 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1055,35 +1055,9 @@ process_request_frame_extents (MetaX11Display *x11_display,
Window xwindow = event->xclient.window;
unsigned long data[4] = { 0, 0, 0, 0 };
- MotifWmHints *hints = NULL;
- gboolean hints_set = FALSE;
-
- meta_verbose ("Setting frame extents for 0x%lx", xwindow);
-
- /* See if the window is decorated. */
- hints_set = meta_prop_get_motif_hints (x11_display,
- xwindow,
- x11_display->atom__MOTIF_WM_HINTS,
- &hints);
- if ((hints_set && hints->decorations) || !hints_set)
- {
- MetaFrameBorders borders;
-
- /* Return estimated frame extents for a normal window. */
- meta_ui_theme_get_frame_borders (x11_display->ui,
- META_FRAME_TYPE_NORMAL,
- 0,
- &borders);
- data[0] = borders.visible.left;
- data[1] = borders.visible.right;
- data[2] = borders.visible.top;
- data[3] = borders.visible.bottom;
- }
-
meta_topic (META_DEBUG_GEOMETRY,
- "Setting _NET_FRAME_EXTENTS on unmanaged window 0x%lx "
- "to top = %lu, left = %lu, bottom = %lu, right = %lu",
- xwindow, data[0], data[1], data[2], data[3]);
+ "Setting _NET_FRAME_EXTENTS on unmanaged window 0x%lx",
+ xwindow);
meta_x11_error_trap_push (x11_display);
XChangeProperty (x11_display->xdisplay, xwindow,
@@ -1091,8 +1065,6 @@ process_request_frame_extents (MetaX11Display *x11_display,
XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 4);
meta_x11_error_trap_pop (x11_display);
-
- g_free (hints);
}
/* from fvwm2, Copyright Matthias Clasen, Dominik Vogt */