x11: Introduce and use 'x11' debug topic

This replaces all current `meta_verbose (...)` in x11/ with `meta_topic
(META_DEBUG_X11, ...)`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
This commit is contained in:
Jonas Ådahl 2024-09-05 10:58:22 +02:00 committed by Marge Bot
parent 86a16c3cfd
commit 7e9c6489ca
11 changed files with 310 additions and 227 deletions

View File

@ -71,6 +71,7 @@ static const GDebugKey meta_debug_keys[] = {
{ "eis", META_DEBUG_EIS },
{ "kms-deadline", META_DEBUG_KMS_DEADLINE },
{ "session-management", META_DEBUG_SESSION_MANAGEMENT },
{ "x11", META_DEBUG_X11 },
};
static gint verbose_topics = 0;
@ -332,6 +333,8 @@ meta_topic_to_string (MetaDebugTopic topic)
return "KMS_DEADLINE";
case META_DEBUG_SESSION_MANAGEMENT:
return "SESSION_MANAGEMENT";
case META_DEBUG_X11:
return "X11";
}
return "WM";

View File

@ -52,6 +52,7 @@
* @META_DEBUG_EIS: eis state
* @META_DEBUG_KMS_DEADLINE: KMS deadline timers
* @META_DEBUG_SESSION_MANAGEMENT: session management
* @META_DEBUG_X11: X11 window management
*/
typedef enum
{
@ -87,6 +88,7 @@ typedef enum
META_DEBUG_EIS = 1 << 28,
META_DEBUG_KMS_DEADLINE = 1 << 29,
META_DEBUG_SESSION_MANAGEMENT = 1 << 30,
META_DEBUG_X11 = 1 << 31,
} MetaDebugTopic;
META_EXPORT

View File

@ -1112,7 +1112,9 @@ process_selection_request (MetaX11Display *x11_display,
event->xselectionrequest.selection);
mtk_x11_error_trap_pop (x11_display->xdisplay);
meta_verbose ("Selection request with selection %s window 0x%lx not a WM_Sn selection we recognize",
meta_topic (META_DEBUG_X11,
"Selection request with selection %s window 0x%lx "
"not a WM_Sn selection we recognize",
str ? str : "(bad atom)", event->xselectionrequest.owner);
meta_XFree (str);
@ -1192,7 +1194,7 @@ process_selection_request (MetaX11Display *x11_display,
event->xselectionrequest.requestor,
False, 0L, (XEvent*)&reply);
meta_verbose ("Handled selection request");
meta_topic (META_DEBUG_X11, "Handled selection request");
}
static void
@ -1222,7 +1224,9 @@ process_selection_clear (MetaX11Display *x11_display,
event->xselectionclear.selection);
mtk_x11_error_trap_pop (x11_display->xdisplay);
meta_verbose ("Selection clear with selection %s window 0x%lx not a WM_Sn selection we recognize",
meta_topic (META_DEBUG_X11,
"Selection clear with selection %s window 0x%lx "
"not a WM_Sn selection we recognize",
str ? str : "(bad atom)", event->xselectionclear.window);
meta_XFree (str);
@ -1230,7 +1234,7 @@ process_selection_clear (MetaX11Display *x11_display,
return FALSE;
}
meta_verbose ("Got selection clear for on display %s",
meta_topic (META_DEBUG_X11, "Got selection clear for on display %s",
x11_display->name);
/* We can't close a Display in an event handler. */
@ -1511,7 +1515,8 @@ handle_other_xevent (MetaX11Display *x11_display,
}
else
{
meta_verbose ("MapRequest on %s mapped = %d minimized = %d",
meta_topic (META_DEBUG_X11,
"MapRequest on %s mapped = %d minimized = %d",
window->desc, window->mapped, window->minimized);
if (window->minimized && !frame_was_receiver)
@ -1519,7 +1524,9 @@ handle_other_xevent (MetaX11Display *x11_display,
meta_window_unminimize (window);
if (window->workspace != workspace_manager->active_workspace)
{
meta_verbose ("Changing workspace due to MapRequest mapped = %d minimized = %d",
meta_topic (META_DEBUG_X11,
"Changing workspace due to MapRequest "
"mapped = %d minimized = %d",
window->mapped, window->minimized);
meta_window_change_workspace (window,
workspace_manager->active_workspace);
@ -1571,7 +1578,9 @@ handle_other_xevent (MetaX11Display *x11_display,
xwc.height = event->xconfigurerequest.height;
xwc.border_width = event->xconfigurerequest.border_width;
meta_verbose ("Configuring withdrawn window to %d,%d %dx%d border %d (some values may not be in mask)",
meta_topic (META_DEBUG_X11,
"Configuring withdrawn window to %d,%d %dx%d border %d "
"(some values may not be in mask)",
xwc.x, xwc.y, xwc.width, xwc.height, xwc.border_width);
mtk_x11_error_trap_push (x11_display->xdisplay);
XConfigureWindow (x11_display->xdisplay, event->xconfigurerequest.window,
@ -1664,7 +1673,8 @@ handle_other_xevent (MetaX11Display *x11_display,
space = event->xclient.data.l[0];
time = event->xclient.data.l[1];
meta_verbose ("Request to change current workspace to %d with "
meta_topic (META_DEBUG_X11,
"Request to change current workspace to %d with "
"specified timestamp of %u",
space, time);
@ -1680,7 +1690,7 @@ handle_other_xevent (MetaX11Display *x11_display,
}
else
{
meta_verbose ("Don't know about workspace %d", space);
meta_topic (META_DEBUG_X11, "Don't know about workspace %d", space);
}
}
else if (event->xclient.message_type ==
@ -1690,7 +1700,7 @@ handle_other_xevent (MetaX11Display *x11_display,
num_spaces = event->xclient.data.l[0];
meta_verbose ("Request to set number of workspaces to %d",
meta_topic (META_DEBUG_X11, "Request to set number of workspaces to %d",
num_spaces);
meta_prefs_set_num_workspaces (num_spaces);
@ -1704,7 +1714,7 @@ handle_other_xevent (MetaX11Display *x11_display,
showing_desktop = event->xclient.data.l[0] != 0;
/* FIXME: Braindead protocol doesn't have a timestamp */
timestamp = meta_x11_display_get_current_time_roundtrip (x11_display);
meta_verbose ("Request to %s desktop",
meta_topic (META_DEBUG_X11, "Request to %s desktop",
showing_desktop ? "show" : "hide");
if (showing_desktop)
@ -1718,7 +1728,7 @@ handle_other_xevent (MetaX11Display *x11_display,
else if (event->xclient.message_type ==
x11_display->atom_WM_PROTOCOLS)
{
meta_verbose ("Received WM_PROTOCOLS message");
meta_topic (META_DEBUG_X11, "Received WM_PROTOCOLS message");
if ((Atom)event->xclient.data.l[0] == x11_display->atom__NET_WM_PING)
{
@ -1732,7 +1742,8 @@ handle_other_xevent (MetaX11Display *x11_display,
if (event->xclient.message_type ==
x11_display->atom__NET_REQUEST_FRAME_EXTENTS)
{
meta_verbose ("Received _NET_REQUEST_FRAME_EXTENTS message");
meta_topic (META_DEBUG_X11,
"Received _NET_REQUEST_FRAME_EXTENTS message");
process_request_frame_extents (x11_display, event);
}
}

View File

@ -140,7 +140,8 @@ reload_wm_client_machine (MetaGroup *group,
if (value->type != META_PROP_VALUE_INVALID)
group->wm_client_machine = g_strdup (value->v.str);
meta_verbose ("Group has client machine \"%s\"",
meta_topic (META_DEBUG_X11,
"Group has client machine \"%s\"",
group->wm_client_machine ? group->wm_client_machine : "unset");
}
@ -163,7 +164,8 @@ reload_net_startup_id (MetaGroup *group,
if (value->type != META_PROP_VALUE_INVALID)
group->startup_id = g_strdup (value->v.str);
meta_verbose ("Group has startup id \"%s\"",
meta_topic (META_DEBUG_X11,
"Group has startup id \"%s\"",
group->startup_id ? group->startup_id : "unset");
}

View File

@ -76,7 +76,8 @@ meta_sync_counter_set_counter (MetaSyncCounter *sync_counter,
if (sync_counter->sync_request_counter != None)
{
meta_verbose ("Window has _NET_WM_SYNC_REQUEST_COUNTER 0x%lx (extended=%s)",
meta_topic (META_DEBUG_X11,
"Window has _NET_WM_SYNC_REQUEST_COUNTER 0x%lx (extended=%s)",
sync_counter->sync_request_counter,
sync_counter->extended_sync_request_counter ? "true" : "false");
}

View File

@ -479,7 +479,8 @@ query_xsync_extension (MetaX11Display *x11_display)
XSyncSetPriority (x11_display->xdisplay, None, 10);
}
meta_verbose ("Attempted to init Xsync, found version %d.%d error base %d event base %d",
meta_topic (META_DEBUG_X11,
"Attempted to init Xsync, found version %d.%d error base %d event base %d",
major, minor,
x11_display->xsync_error_base,
x11_display->xsync_event_base);
@ -503,7 +504,8 @@ query_xshape_extension (MetaX11Display *x11_display)
else
x11_display->have_shape = TRUE;
meta_verbose ("Attempted to init Shape, found error base %d event base %d",
meta_topic (META_DEBUG_X11,
"Attempted to init Shape, found error base %d event base %d",
x11_display->shape_error_base,
x11_display->shape_event_base);
}
@ -540,7 +542,8 @@ query_xcomposite_extension (MetaX11Display *x11_display)
}
}
meta_verbose ("Attempted to init Composite, found error base %d event base %d "
meta_topic (META_DEBUG_X11,
"Attempted to init Composite, found error base %d event base %d "
"extn ver %d %d",
x11_display->composite_error_base,
x11_display->composite_event_base,
@ -566,7 +569,8 @@ query_xdamage_extension (MetaX11Display *x11_display)
else
x11_display->have_damage = TRUE;
meta_verbose ("Attempted to init Damage, found error base %d event base %d",
meta_topic (META_DEBUG_X11,
"Attempted to init Damage, found error base %d event base %d",
x11_display->damage_error_base,
x11_display->damage_event_base);
}
@ -593,7 +597,8 @@ query_xfixes_extension (MetaX11Display *x11_display)
meta_fatal ("Mutter requires XFixes 5.0");
}
meta_verbose ("Attempted to init XFixes, found error base %d event base %d",
meta_topic (META_DEBUG_X11,
"Attempted to init XFixes, found error base %d event base %d",
x11_display->xfixes_error_base,
x11_display->xfixes_event_base);
}
@ -703,7 +708,8 @@ set_desktop_geometry_hint (MetaX11Display *x11_display)
data[0] = monitor_width;
data[1] = monitor_height;
meta_verbose ("Setting _NET_DESKTOP_GEOMETRY to %lu, %lu", data[0], data[1]);
meta_topic (META_DEBUG_X11,
"Setting _NET_DESKTOP_GEOMETRY to %lu, %lu", data[0], data[1]);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
@ -728,7 +734,7 @@ set_desktop_viewport_hint (MetaX11Display *x11_display)
data[0] = 0;
data[1] = 0;
meta_verbose ("Setting _NET_DESKTOP_VIEWPORT to 0, 0");
meta_topic (META_DEBUG_X11, "Setting _NET_DESKTOP_VIEWPORT to 0, 0");
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
@ -891,7 +897,7 @@ take_manager_selection (MetaX11Display *x11_display,
/* We sort of block infinitely here which is probably lame. */
meta_verbose ("Waiting for old window manager to exit");
meta_topic (META_DEBUG_X11, "Waiting for old window manager to exit");
do
XWindowEvent (x11_display->xdisplay, current_owner, StructureNotifyMask, &event);
while (event.type != DestroyNotify);
@ -992,7 +998,7 @@ set_active_workspace_hint (MetaWorkspaceManager *workspace_manager,
data[0] = meta_workspace_index (workspace_manager->active_workspace);
meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu", data[0]);
meta_topic (META_DEBUG_X11, "Setting _NET_CURRENT_DESKTOP to %lu", data[0]);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
@ -1016,7 +1022,8 @@ set_number_of_spaces_hint (MetaWorkspaceManager *workspace_manager,
data[0] = meta_workspace_manager_get_n_workspaces (workspace_manager);
meta_verbose ("Setting _NET_NUMBER_OF_DESKTOPS to %lu", data[0]);
meta_topic (META_DEBUG_X11,
"Setting _NET_NUMBER_OF_DESKTOPS to %lu", data[0]);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
@ -1221,7 +1228,7 @@ open_x_display (MetaDisplay *display,
return NULL;
}
meta_verbose ("Opening display '%s'", xdisplay_name);
meta_topic (META_DEBUG_X11, "Opening display '%s'", xdisplay_name);
xdisplay = XOpenDisplay (xdisplay_name);
@ -1501,7 +1508,7 @@ meta_x11_display_new (MetaDisplay *display,
x11_display->default_xvisual = DefaultVisualOfScreen (xscreen);
x11_display->default_depth = DefaultDepthOfScreen (xscreen);
meta_verbose ("Creating %d atoms", (int) G_N_ELEMENTS (atom_names));
meta_topic (META_DEBUG_X11, "Creating %d atoms", (int) G_N_ELEMENTS (atom_names));
XInternAtoms (xdisplay, (char **)atom_names, G_N_ELEMENTS (atom_names),
False, atoms);
@ -1758,7 +1765,7 @@ meta_x11_display_restore_active_workspace (MetaX11Display *x11_display)
x11_display->atom__NET_CURRENT_DESKTOP,
&current_workspace_index))
{
meta_verbose ("Read existing _NET_CURRENT_DESKTOP = %d",
meta_topic (META_DEBUG_X11, "Read existing _NET_CURRENT_DESKTOP = %d",
(int) current_workspace_index);
/* Switch to the _NET_CURRENT_DESKTOP workspace */
@ -1770,7 +1777,7 @@ meta_x11_display_restore_active_workspace (MetaX11Display *x11_display)
}
else
{
meta_verbose ("No _NET_CURRENT_DESKTOP present");
meta_topic (META_DEBUG_X11, "No _NET_CURRENT_DESKTOP present");
}
set_active_workspace_hint (display->workspace_manager, x11_display);
@ -2518,7 +2525,8 @@ meta_x11_display_update_workspace_names (MetaX11Display *x11_display)
x11_display->atom__NET_DESKTOP_NAMES,
&names, &n_names))
{
meta_verbose ("Failed to get workspace names from root window");
meta_topic (META_DEBUG_X11,
"Failed to get workspace names from root window");
return;
}

View File

@ -98,11 +98,12 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window,
meta_sync_counter_init (&frame->sync_counter, window, frame->xwindow);
meta_verbose ("Frame geometry %d,%d %dx%d",
meta_topic (META_DEBUG_X11, "Frame geometry %d,%d %dx%d",
frame->rect.x, frame->rect.y,
frame->rect.width, frame->rect.height);
meta_verbose ("Setting frame 0x%lx for window %s, "
meta_topic (META_DEBUG_X11,
"Setting frame 0x%lx for window %s, "
"frame geometry %d,%d %dx%d",
xframe, window->desc,
frame->rect.x, frame->rect.y,
@ -112,7 +113,8 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window,
frame->xwindow,
create_serial);
meta_verbose ("Frame for %s is 0x%lx", frame->window->desc, frame->xwindow);
meta_topic (META_DEBUG_X11,
"Frame for %s is 0x%lx", frame->window->desc, frame->xwindow);
mtk_x11_error_trap_push (x11_display->xdisplay);
@ -222,7 +224,7 @@ meta_window_destroy_frame (MetaWindow *window)
x11_display = window->display->x11_display;
meta_verbose ("Unframing window %s", window->desc);
meta_topic (META_DEBUG_X11, "Unframing window %s", window->desc);
frame = g_steal_pointer (&priv->frame);

View File

@ -374,7 +374,7 @@ meta_x11_keybindings_grab_window_buttons (MetaKeyBindingManager *keys,
* Grab Alt + button3 for popping up window menu.
* Grab Alt + Shift + button1 for snap-moving window.
*/
meta_verbose ("Grabbing window buttons for %s", window->desc);
meta_topic (META_DEBUG_X11, "Grabbing window buttons for %s", window->desc);
/* FIXME If we ignored errors here instead of spewing, we could
* put one big error trap around the loop and avoid a bunch of
@ -415,14 +415,19 @@ meta_x11_keybindings_grab_focus_window_button (MetaKeyBindingManager *keys,
MetaWindow *window)
{
/* Grab button 1 for activating unfocused windows */
meta_verbose ("Grabbing unfocused window buttons for %s", window->desc);
if (window->have_focus_click_grab)
{
meta_verbose (" (well, not grabbing since we already have the grab)");
meta_topic (META_DEBUG_X11,
"Not grabbing unfocused window buttons for %s "
"since we already have the grab",
window->desc);
return;
}
meta_topic (META_DEBUG_X11,
"Grabbing unfocused window buttons for %s", window->desc);
/* FIXME If we ignored errors here instead of spewing, we could
* put one big error trap around the loop and avoid a bunch of
* XSync()
@ -436,7 +441,8 @@ void
meta_x11_keybindings_ungrab_focus_window_button (MetaKeyBindingManager *keys,
MetaWindow *window)
{
meta_verbose ("Ungrabbing unfocused window buttons for %s", window->desc);
meta_topic (META_DEBUG_X11,
"Ungrabbing unfocused window buttons for %s", window->desc);
if (!window->have_focus_click_grab)
return;

View File

@ -219,7 +219,8 @@ reload_wm_client_machine (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID)
priv->wm_client_machine = g_strdup (value->v.str);
meta_verbose ("Window has client machine \"%s\"",
meta_topic (META_DEBUG_X11,
"Window has client machine \"%s\"",
priv->wm_client_machine ? priv->wm_client_machine : "unset");
if (priv->wm_client_machine == NULL)
@ -298,7 +299,8 @@ reload_icon_geometry (MetaWindow *window,
{
if (value->v.cardinal_list.n_cardinals != 4)
{
meta_verbose ("_NET_WM_ICON_GEOMETRY on %s has %d values instead of 4",
meta_topic (META_DEBUG_X11,
"_NET_WM_ICON_GEOMETRY on %s has %d values instead of 4",
window->desc, value->v.cardinal_list.n_cardinals);
}
else
@ -373,7 +375,8 @@ reload_gtk_frame_extents (MetaWindow *window,
{
if (value->v.cardinal_list.n_cardinals != 4)
{
meta_verbose ("_GTK_FRAME_EXTENTS on %s has %d values instead of 4",
meta_topic (META_DEBUG_X11,
"_GTK_FRAME_EXTENTS on %s has %d values instead of 4",
window->desc, value->v.cardinal_list.n_cardinals);
}
else
@ -609,7 +612,8 @@ reload_net_wm_name (MetaWindow *window,
set_window_title (window, value->v.str);
priv->using_net_wm_name = TRUE;
meta_verbose ("Using _NET_WM_NAME for new title of %s: \"%s\"",
meta_topic (META_DEBUG_X11,
"Using _NET_WM_NAME for new title of %s: \"%s\"",
window->desc, window->title);
}
else
@ -631,7 +635,8 @@ reload_wm_name (MetaWindow *window,
if (priv->using_net_wm_name)
{
meta_verbose ("Ignoring WM_NAME \"%s\" as _NET_WM_NAME is set",
meta_topic (META_DEBUG_X11,
"Ignoring WM_NAME \"%s\" as _NET_WM_NAME is set",
value->v.str);
return;
}
@ -640,7 +645,8 @@ reload_wm_name (MetaWindow *window,
{
set_window_title (window, value->v.str);
meta_verbose ("Using WM_NAME for new title of %s: \"%s\"",
meta_topic (META_DEBUG_X11,
"Using WM_NAME for new title of %s: \"%s\"",
window->desc, window->title);
}
else
@ -685,7 +691,8 @@ reload_opaque_region (MetaWindow *window,
if (nitems % 4 != 0)
{
meta_verbose ("_NET_WM_OPAQUE_REGION does not have a list of 4-tuples.");
meta_topic (META_DEBUG_X11,
"_NET_WM_OPAQUE_REGION does not have a list of 4-tuples.");
goto out;
}
@ -779,16 +786,12 @@ reload_net_wm_state (MetaWindow *window,
MetaX11Display *x11_display = window->display->x11_display;
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11);
int i;
/* We know this is only an initial window creation,
* clients don't change the property.
*/
if (!initial) {
/* no, they DON'T change the property */
meta_verbose ("Ignoring _NET_WM_STATE: we should be the one who set "
if (!initial)
{
meta_topic (META_DEBUG_X11,
"Ignoring _NET_WM_STATE: we should be the one who set "
"the property in the first place");
return;
}
@ -838,7 +841,8 @@ reload_net_wm_state (MetaWindow *window,
++i;
}
meta_verbose ("Reloaded _NET_WM_STATE for %s",
meta_topic (META_DEBUG_X11,
"Reloaded _NET_WM_STATE for %s",
window->desc);
meta_window_x11_recalc_window_type (window);
@ -863,7 +867,7 @@ reload_mwm_hints (MetaWindow *window,
if (value->type == META_PROP_VALUE_INVALID)
{
meta_verbose ("Window %s has no MWM hints", window->desc);
meta_topic (META_DEBUG_X11, "Window %s has no MWM hints", window->desc);
meta_window_recalc_features (window);
return;
}
@ -872,12 +876,12 @@ reload_mwm_hints (MetaWindow *window,
/* We support those MWM hints deemed non-stupid */
meta_verbose ("Window %s has MWM hints",
meta_topic (META_DEBUG_X11, "Window %s has MWM hints",
window->desc);
if (hints->flags & MWM_HINTS_DECORATIONS)
{
meta_verbose ("Window %s sets MWM_HINTS_DECORATIONS 0x%x",
meta_topic (META_DEBUG_X11, "Window %s sets MWM_HINTS_DECORATIONS 0x%x",
window->desc, hints->decorations);
if (hints->decorations == 0)
@ -887,13 +891,15 @@ reload_mwm_hints (MetaWindow *window,
window->mwm_border_only = TRUE;
}
else
meta_verbose ("Decorations flag unset");
{
meta_topic (META_DEBUG_X11, "Decorations flag unset");
}
if (hints->flags & MWM_HINTS_FUNCTIONS)
{
gboolean toggle_value;
meta_verbose ("Window %s sets MWM_HINTS_FUNCTIONS 0x%x",
meta_topic (META_DEBUG_X11, "Window %s sets MWM_HINTS_FUNCTIONS 0x%x",
window->desc, hints->functions);
/* If _ALL is specified, then other flags indicate what to turn off;
@ -905,7 +911,7 @@ reload_mwm_hints (MetaWindow *window,
{
toggle_value = TRUE;
meta_verbose ("Window %s disables all funcs then reenables some",
meta_topic (META_DEBUG_X11, "Window %s disables all funcs then reenables some",
window->desc);
window->mwm_has_close_func = FALSE;
window->mwm_has_minimize_func = FALSE;
@ -915,45 +921,45 @@ reload_mwm_hints (MetaWindow *window,
}
else
{
meta_verbose ("Window %s enables all funcs then disables some",
meta_topic (META_DEBUG_X11, "Window %s enables all funcs then disables some",
window->desc);
toggle_value = FALSE;
}
if ((hints->functions & MWM_FUNC_CLOSE) != 0)
{
meta_verbose ("Window %s toggles close via MWM hints",
meta_topic (META_DEBUG_X11, "Window %s toggles close via MWM hints",
window->desc);
window->mwm_has_close_func = toggle_value;
}
if ((hints->functions & MWM_FUNC_MINIMIZE) != 0)
{
meta_verbose ("Window %s toggles minimize via MWM hints",
meta_topic (META_DEBUG_X11, "Window %s toggles minimize via MWM hints",
window->desc);
window->mwm_has_minimize_func = toggle_value;
}
if ((hints->functions & MWM_FUNC_MAXIMIZE) != 0)
{
meta_verbose ("Window %s toggles maximize via MWM hints",
meta_topic (META_DEBUG_X11, "Window %s toggles maximize via MWM hints",
window->desc);
window->mwm_has_maximize_func = toggle_value;
}
if ((hints->functions & MWM_FUNC_MOVE) != 0)
{
meta_verbose ("Window %s toggles move via MWM hints",
meta_topic (META_DEBUG_X11, "Window %s toggles move via MWM hints",
window->desc);
window->mwm_has_move_func = toggle_value;
}
if ((hints->functions & MWM_FUNC_RESIZE) != 0)
{
meta_verbose ("Window %s toggles resize via MWM hints",
meta_topic (META_DEBUG_X11, "Window %s toggles resize via MWM hints",
window->desc);
window->mwm_has_resize_func = toggle_value;
}
}
else
{
meta_verbose ("Functions flag unset");
meta_topic (META_DEBUG_X11, "Functions flag unset");
}
meta_window_recalc_features (window);
@ -996,7 +1002,7 @@ reload_wm_class (MetaWindow *window,
meta_window_set_wm_class (window, NULL, NULL);
}
meta_verbose ("Window %s class: '%s' name: '%s'",
meta_topic (META_DEBUG_X11, "Window %s class: '%s' name: '%s'",
window->desc,
window->res_class ? window->res_class : "none",
window->res_name ? window->res_name : "none");
@ -1052,7 +1058,8 @@ reload_net_startup_id (MetaWindow *window,
}
}
meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s",
meta_topic (META_DEBUG_X11,
"New _NET_STARTUP_ID \"%s\" for %s",
window->startup_id ? window->startup_id : "unset",
window->desc);
}
@ -1355,7 +1362,8 @@ reload_wm_protocols (MetaWindow *window,
++i;
}
meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s",
meta_topic (META_DEBUG_X11,
"New _NET_STARTUP_ID \"%s\" for %s",
window->startup_id ? window->startup_id : "unset",
window->desc);
}
@ -1402,7 +1410,8 @@ reload_wm_hints (MetaWindow *window,
if (hints->flags & XUrgencyHint)
urgent = TRUE;
meta_verbose ("Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx",
meta_topic (META_DEBUG_X11,
"Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx",
window->input, window->initially_iconic,
priv->xgroup_leader,
priv->wm_hints_pixmap,
@ -1411,7 +1420,8 @@ reload_wm_hints (MetaWindow *window,
if (priv->xgroup_leader != old_group_leader)
{
meta_verbose ("Window %s changed its group leader to 0x%lx",
meta_topic (META_DEBUG_X11,
"Window %s changed its group leader to 0x%lx",
window->desc, priv->xgroup_leader);
meta_window_x11_group_leader_changed (window);
@ -1509,9 +1519,14 @@ reload_transient_for (MetaWindow *window,
current_transient_for = transient_for;
if (current_transient_for != None)
meta_verbose ("Window %s transient for 0x%lx", window->desc, current_transient_for);
{
meta_topic (META_DEBUG_X11, "Window %s transient for 0x%lx",
window->desc, current_transient_for);
}
else
meta_verbose ("Window %s is not transient", window->desc);
{
meta_topic (META_DEBUG_X11, "Window %s is not transient", window->desc);
}
if (current_transient_for == None ||
current_transient_for == window->display->x11_display->xroot)
@ -1533,7 +1548,8 @@ reload_gtk_theme_variant (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID)
{
requested_variant = value->v.str;
meta_verbose ("Requested \"%s\" theme variant for window %s.",
meta_topic (META_DEBUG_X11,
"Requested \"%s\" theme variant for window %s.",
requested_variant, window->desc);
}
@ -1565,11 +1581,19 @@ reload_bypass_compositor (MetaWindow *window,
return;
if (requested_value == META_BYPASS_COMPOSITOR_HINT_ON)
meta_verbose ("Request to bypass compositor for window %s.", window->desc);
{
meta_topic (META_DEBUG_X11,
"Request to bypass compositor for window %s.", window->desc);
}
else if (requested_value == META_BYPASS_COMPOSITOR_HINT_OFF)
meta_verbose ("Request to don't bypass compositor for window %s.", window->desc);
{
meta_topic (META_DEBUG_X11,
"Request to don't bypass compositor for window %s.", window->desc);
}
else if (requested_value != META_BYPASS_COMPOSITOR_HINT_AUTO)
{
return;
}
priv->bypass_compositor = requested_value;
}

View File

@ -267,7 +267,8 @@ update_sm_hints (MetaWindow *window)
}
else
{
meta_verbose ("Didn't find a client leader for %s", window->desc);
meta_topic (META_DEBUG_X11,
"Didn't find a client leader for %s", window->desc);
if (!meta_prefs_get_disable_workarounds ())
{
@ -280,12 +281,18 @@ update_sm_hints (MetaWindow *window)
&priv->sm_client_id);
if (priv->sm_client_id)
meta_warning ("Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER window as specified in the ICCCM.",
{
meta_topic (META_DEBUG_X11,
"Window %s sets SM_CLIENT_ID on itself, "
"instead of on the WM_CLIENT_LEADER window "
"as specified in the ICCCM.",
window->desc);
}
}
}
meta_verbose ("Window %s client leader: 0x%lx SM_CLIENT_ID: '%s'",
meta_topic (META_DEBUG_X11,
"Window %s client leader: 0x%lx SM_CLIENT_ID: '%s'",
window->desc, priv->xclient_leader,
priv->sm_client_id ? priv->sm_client_id : "none");
}
@ -726,7 +733,8 @@ meta_window_x11_unmanage (MetaWindow *window)
/* We need to clean off the window's state so it
* won't be restored if the app maps it again.
*/
meta_verbose ("Cleaning state from window %s", window->desc);
meta_topic (META_DEBUG_X11,
"Cleaning state from window %s", window->desc);
XDeleteProperty (x11_display->xdisplay,
priv->xwindow,
x11_display->atom__NET_WM_DESKTOP);
@ -1324,7 +1332,8 @@ update_gtk_edge_constraints (MetaWindow *window)
data[0] = edge_constraints_to_gtk_edge_constraints (window);
meta_verbose ("Setting _GTK_EDGE_CONSTRAINTS to %lu", data[0]);
meta_topic (META_DEBUG_X11,
"Setting _GTK_EDGE_CONSTRAINTS to %lu", data[0]);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
@ -1358,7 +1367,8 @@ meta_window_x11_current_workspace_changed (MetaWindow *window)
data[0] = meta_window_get_net_wm_desktop (window);
meta_verbose ("Setting _NET_WM_DESKTOP of %s to %lu",
meta_topic (META_DEBUG_X11,
"Setting _NET_WM_DESKTOP of %s to %lu",
window->desc, data[0]);
mtk_x11_error_trap_push (x11_display->xdisplay);
@ -1654,7 +1664,7 @@ meta_window_x11_update_struts (MetaWindow *window)
g_return_val_if_fail (!window->override_redirect, FALSE);
meta_verbose ("Updating struts for %s", window->desc);
meta_topic (META_DEBUG_X11, "Updating struts for %s", window->desc);
Window xwindow = meta_window_x11_get_xwindow (window);
old_struts = g_steal_pointer (&window->struts);
@ -1666,9 +1676,11 @@ meta_window_x11_update_struts (MetaWindow *window)
&struts, &nitems))
{
if (nitems != 12)
meta_verbose ("_NET_WM_STRUT_PARTIAL on %s has %d values instead "
"of 12",
{
meta_topic (META_DEBUG_X11,
"_NET_WM_STRUT_PARTIAL on %s has %d values instead of 12.",
window->desc, nitems);
}
else
{
/* Pull out the strut info for each side in the hint */
@ -1724,7 +1736,8 @@ meta_window_x11_update_struts (MetaWindow *window)
new_struts = g_slist_prepend (new_struts, temp);
}
meta_verbose ("_NET_WM_STRUT_PARTIAL struts %u %u %u %u for "
meta_topic (META_DEBUG_X11,
"_NET_WM_STRUT_PARTIAL struts %u %u %u %u for "
"window %s",
struts[0], struts[1], struts[2], struts[3],
window->desc);
@ -1733,7 +1746,8 @@ meta_window_x11_update_struts (MetaWindow *window)
}
else
{
meta_verbose ("No _NET_WM_STRUT property for %s",
meta_topic (META_DEBUG_X11,
"No _NET_WM_STRUT property for %s",
window->desc);
}
@ -1744,7 +1758,8 @@ meta_window_x11_update_struts (MetaWindow *window)
&struts, &nitems))
{
if (nitems != 4)
meta_verbose ("_NET_WM_STRUT on %s has %d values instead of 4",
meta_topic (META_DEBUG_X11,
"_NET_WM_STRUT on %s has %d values instead of 4",
window->desc, nitems);
else
{
@ -1789,7 +1804,8 @@ meta_window_x11_update_struts (MetaWindow *window)
new_struts = g_slist_prepend (new_struts, temp);
}
meta_verbose ("_NET_WM_STRUT struts %u %u %u %u for window %s",
meta_topic (META_DEBUG_X11,
"_NET_WM_STRUT struts %u %u %u %u for window %s",
struts[0], struts[1], struts[2], struts[3],
window->desc);
}
@ -1797,7 +1813,7 @@ meta_window_x11_update_struts (MetaWindow *window)
}
else if (!new_struts)
{
meta_verbose ("No _NET_WM_STRUT property for %s",
meta_topic (META_DEBUG_X11, "No _NET_WM_STRUT property for %s",
window->desc);
}
@ -2162,7 +2178,8 @@ meta_window_x11_constructed (GObject *object)
XWindowAttributes attrs = priv->attributes;
MtkRectangle rect;
meta_verbose ("attrs->map_state = %d (%s)",
meta_topic (META_DEBUG_X11,
"attrs->map_state = %d (%s)",
attrs.map_state,
(attrs.map_state == IsUnmapped) ?
"IsUnmapped" :
@ -2401,7 +2418,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
++i;
}
meta_verbose ("Setting _NET_WM_STATE with %d atoms", i);
meta_topic (META_DEBUG_X11, "Setting _NET_WM_STATE with %d atoms", i);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay, priv->xwindow,
@ -2437,7 +2454,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
meta_x11_display_logical_monitor_to_xinerama_index (window->display->x11_display,
window->fullscreen_monitors.right);
meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS");
meta_topic (META_DEBUG_X11, "Setting _NET_WM_FULLSCREEN_MONITORS");
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,
priv->xwindow,
@ -2448,7 +2465,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window)
}
else
{
meta_verbose ("Clearing _NET_WM_FULLSCREEN_MONITORS");
meta_topic (META_DEBUG_X11, "Clearing _NET_WM_FULLSCREEN_MONITORS");
mtk_x11_error_trap_push (x11_display->xdisplay);
XDeleteProperty (x11_display->xdisplay,
priv->xwindow,
@ -3134,7 +3151,8 @@ meta_window_x11_configure_request (MetaWindow *window,
return TRUE;
meta_topic (META_DEBUG_STACK,
"xconfigure stacking request from window %s sibling %s stackmode %d",
"xconfigure stacking request from window %s "
"sibling %s stackmode %d",
window->desc, sibling->desc, event->xconfigurerequest.detail);
}
restack_window (window, sibling, event->xconfigurerequest.detail);
@ -3156,7 +3174,7 @@ meta_window_x11_impl_process_property_notify (MetaWindow *window,
char *property_name = XGetAtomName (window->display->x11_display->xdisplay,
event->atom);
meta_verbose ("Property notify on %s for %s",
meta_topic (META_DEBUG_X11, "Property notify on %s for %s",
window->desc, property_name);
XFree (property_name);
}
@ -3377,7 +3395,7 @@ meta_window_x11_client_message (MetaWindow *window,
space = event->xclient.data.l[0];
meta_verbose ("Request to move %s to workspace %d",
meta_topic (META_DEBUG_X11, "Request to move %s to workspace %d",
window->desc, space);
workspace =
@ -3389,9 +3407,9 @@ meta_window_x11_client_message (MetaWindow *window,
else if (space == (int) 0xFFFFFFFF)
meta_window_stick (window);
else
meta_verbose ("No such workspace %d for screen", space);
meta_topic (META_DEBUG_X11, "No such workspace %d for screen", space);
meta_verbose ("Window %s now on_all_workspaces = %d",
meta_topic (META_DEBUG_X11, "Window %s now on_all_workspaces = %d",
window->desc, window->on_all_workspaces);
return TRUE;
@ -3422,7 +3440,7 @@ meta_window_x11_client_message (MetaWindow *window,
if (mtk_x11_error_trap_pop_with_return (x11_display->xdisplay) != Success)
str2 = NULL;
meta_verbose ("Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s",
meta_topic (META_DEBUG_X11, "Request to change _NET_WM_STATE action %lu atom1: %s atom2: %s",
action,
str1 ? str1 : "(unknown)",
str2 ? str2 : "(unknown)");
@ -3558,7 +3576,7 @@ meta_window_x11_client_message (MetaWindow *window,
else if (event->xclient.message_type ==
x11_display->atom_WM_CHANGE_STATE)
{
meta_verbose ("WM_CHANGE_STATE client message, state: %ld",
meta_topic (META_DEBUG_X11, "WM_CHANGE_STATE client message, state: %ld",
event->xclient.data.l[0]);
if (event->xclient.data.l[0] == IconicState)
meta_window_minimize (window);
@ -3775,7 +3793,7 @@ meta_window_x11_client_message (MetaWindow *window,
MetaClientType source_indication;
guint32 timestamp;
meta_verbose ("_NET_ACTIVE_WINDOW request for window '%s', activating",
meta_topic (META_DEBUG_X11, "_NET_ACTIVE_WINDOW request for window '%s', activating",
window->desc);
source_indication = event->xclient.data.l[0];
@ -3801,7 +3819,8 @@ meta_window_x11_client_message (MetaWindow *window,
{
MetaLogicalMonitor *top, *bottom, *left, *right;
meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'",
meta_topic (META_DEBUG_X11,
"_NET_WM_FULLSCREEN_MONITORS request for window '%s'",
window->desc);
top =
@ -4043,11 +4062,11 @@ meta_window_x11_new (MetaDisplay *display,
MetaWindow *window = NULL;
gulong event_mask;
meta_verbose ("Attempting to manage 0x%lx", xwindow);
meta_topic (META_DEBUG_X11, "Attempting to manage 0x%lx", xwindow);
if (meta_x11_display_xwindow_is_a_no_focus_window (x11_display, xwindow))
{
meta_verbose ("Not managing no_focus_window 0x%lx",
meta_topic (META_DEBUG_X11, "Not managing no_focus_window 0x%lx",
xwindow);
return NULL;
}
@ -4063,32 +4082,32 @@ meta_window_x11_new (MetaDisplay *display,
if (!XGetWindowAttributes (x11_display->xdisplay, xwindow, &attrs))
{
meta_verbose ("Failed to get attributes for window 0x%lx",
meta_topic (META_DEBUG_X11, "Failed to get attributes for window 0x%lx",
xwindow);
goto error;
}
if (attrs.root != x11_display->xroot)
{
meta_verbose ("Not on our screen");
meta_topic (META_DEBUG_X11, "Not on our screen");
goto error;
}
if (attrs.class == InputOnly)
{
meta_verbose ("Not managing InputOnly windows");
meta_topic (META_DEBUG_X11, "Not managing InputOnly windows");
goto error;
}
if (is_our_xwindow (x11_display, xwindow, &attrs))
{
meta_verbose ("Not managing our own windows");
meta_topic (META_DEBUG_X11, "Not managing our own windows");
goto error;
}
if (maybe_filter_xwindow (display, xwindow, must_be_viewable, &attrs))
{
meta_verbose ("Not managing filtered window");
meta_topic (META_DEBUG_X11, "Not managing filtered window");
goto error;
}
@ -4105,13 +4124,14 @@ meta_window_x11_new (MetaDisplay *display,
&state) &&
(state == IconicState || state == NormalState)))
{
meta_verbose ("Deciding not to manage unmapped or unviewable window 0x%lx",
meta_topic (META_DEBUG_X11,
"Deciding not to manage unmapped or unviewable window 0x%lx",
xwindow);
goto error;
}
existing_wm_state = state;
meta_verbose ("WM_STATE of %lx = %s", xwindow,
meta_topic (META_DEBUG_X11, "WM_STATE of %lx = %s", xwindow,
wm_state_to_string (existing_wm_state));
}
@ -4170,7 +4190,8 @@ meta_window_x11_new (MetaDisplay *display,
if (mtk_x11_error_trap_pop_with_return (x11_display->xdisplay) != Success)
{
meta_verbose ("Window 0x%lx disappeared just as we tried to manage it",
meta_topic (META_DEBUG_X11,
"Window 0x%lx disappeared just as we tried to manage it",
xwindow);
goto error;
}
@ -4201,7 +4222,8 @@ meta_window_x11_new (MetaDisplay *display,
{
/* WM_STATE said minimized */
window->minimized = TRUE;
meta_verbose ("Window %s had preexisting WM_STATE = IconicState, minimizing",
meta_topic (META_DEBUG_X11,
"Window %s had preexisting WM_STATE = IconicState, minimizing",
window->desc);
/* Assume window was previously placed, though perhaps it's
@ -4333,7 +4355,7 @@ meta_window_x11_recalc_window_type (MetaWindow *window)
}
}
meta_verbose ("Calculated type %u for %s, old type %u",
meta_topic (META_DEBUG_X11, "Calculated type %u for %s, old type %u",
type, window->desc, type);
meta_window_set_type (window, type);
}
@ -4440,7 +4462,8 @@ meta_window_x11_set_allowed_actions_hint (MetaWindow *window)
g_assert (i <= MAX_N_ACTIONS);
meta_verbose ("Setting _NET_WM_ALLOWED_ACTIONS with %d atoms", i);
meta_topic (META_DEBUG_X11,
"Setting _NET_WM_ALLOWED_ACTIONS with %d atoms", i);
mtk_x11_error_trap_push (x11_display->xdisplay);
XChangeProperty (x11_display->xdisplay,

View File

@ -300,7 +300,7 @@ motif_hints_from_results (GetPropertyResults *results,
{
g_free (results->prop);
results->prop = NULL;
meta_verbose ("Motif hints had unexpected type or n_items");
meta_topic (META_DEBUG_X11, "Motif hints had unexpected type or n_items");
return FALSE;
}
@ -681,7 +681,8 @@ wm_hints_from_results (GetPropertyResults *results,
/* pre-R3 bogusly truncated window_group, don't fail on them */
if (results->n_items < (NumPropWMHintsElements - 1))
{
meta_verbose ("WM_HINTS property too short: %d should be %d",
meta_topic (META_DEBUG_X11,
"WM_HINTS property too short: %d should be %d",
(int) results->n_items, NumPropWMHintsElements - 1);
if (results->prop)
{
@ -833,7 +834,7 @@ meta_prop_get_values (MetaX11Display *x11_display,
xcb_get_property_cookie_t *tasks;
xcb_connection_t *xcb_conn = XGetXCBConnection (x11_display->xdisplay);
meta_verbose ("Requesting %d properties of 0x%lx at once",
meta_topic (META_DEBUG_X11, "Requesting %d properties of 0x%lx at once",
n_values, xwindow);
if (n_values == 0)