window/x11: Add a is_ssd helper
Would be useful for moving frame field to WindowX11 in the upcoming commits Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3254>
This commit is contained in:
parent
fff528cbf1
commit
751ef5abd2
@ -709,9 +709,14 @@ update_onscreen_requirements (MetaWindow *window,
|
|||||||
/* Update whether we want future constraint runs to require the
|
/* Update whether we want future constraint runs to require the
|
||||||
* titlebar to be visible.
|
* titlebar to be visible.
|
||||||
*/
|
*/
|
||||||
if (window->frame && window->decorated)
|
#ifdef HAVE_X11_CLIENT
|
||||||
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 && window->decorated)
|
||||||
{
|
{
|
||||||
MtkRectangle titlebar_rect, frame_rect;
|
MtkRectangle titlebar_rect, frame_rect;
|
||||||
|
MetaFrame *frame = meta_window_x11_get_frame (window);
|
||||||
|
|
||||||
|
if (!frame)
|
||||||
|
return;
|
||||||
|
|
||||||
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
@ -730,6 +735,7 @@ update_onscreen_requirements (MetaWindow *window,
|
|||||||
window->desc,
|
window->desc,
|
||||||
window->require_titlebar_visible ? "TRUE" : "FALSE");
|
window->require_titlebar_visible ? "TRUE" : "FALSE");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@ -1703,12 +1709,21 @@ constrain_to_single_monitor (MetaWindow *window,
|
|||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
|
/* a quirk for x11 clients that tries to move their windows
|
||||||
|
* by themselves when doing interactive moves.
|
||||||
|
*/
|
||||||
|
gboolean client_driven_interactive_move = TRUE;
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (info->backend);
|
meta_backend_get_monitor_manager (info->backend);
|
||||||
|
|
||||||
if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_MONITOR)
|
if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_MONITOR)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
|
||||||
|
client_driven_interactive_move = meta_window_x11_get_frame (window) == NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Exit early if we know the constraint won't apply--note that this constraint
|
/* Exit early if we know the constraint won't apply--note that this constraint
|
||||||
* is only meant for normal windows (e.g. we don't want docks to be shoved
|
* is only meant for normal windows (e.g. we don't want docks to be shoved
|
||||||
* "onscreen" by their own strut) and we can't apply it to frameless windows
|
* "onscreen" by their own strut) and we can't apply it to frameless windows
|
||||||
@ -1718,7 +1733,7 @@ constrain_to_single_monitor (MetaWindow *window,
|
|||||||
window->type == META_WINDOW_DOCK ||
|
window->type == META_WINDOW_DOCK ||
|
||||||
meta_monitor_manager_get_num_logical_monitors (monitor_manager) == 1 ||
|
meta_monitor_manager_get_num_logical_monitors (monitor_manager) == 1 ||
|
||||||
!window->require_on_single_monitor ||
|
!window->require_on_single_monitor ||
|
||||||
!window->frame ||
|
client_driven_interactive_move ||
|
||||||
info->is_user_action ||
|
info->is_user_action ||
|
||||||
meta_window_get_placement_rule (window))
|
meta_window_get_placement_rule (window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -808,9 +808,11 @@ client_window_should_be_mapped (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
|
||||||
window->decorated && !window->frame)
|
window->decorated && !meta_window_x11_is_ssd (window))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1701,9 +1703,11 @@ meta_window_is_showable (MetaWindow *window)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_X11_CLIENT
|
||||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11 &&
|
||||||
window->decorated && !window->frame)
|
window->decorated && !meta_window_x11_is_ssd (window))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1483,7 +1483,7 @@ handle_other_xevent (MetaX11Display *x11_display,
|
|||||||
window = meta_x11_display_lookup_x_window (x11_display,
|
window = meta_x11_display_lookup_x_window (x11_display,
|
||||||
client_window);
|
client_window);
|
||||||
|
|
||||||
if (window != NULL && window->decorated && !window->frame)
|
if (window != NULL && window->decorated && !meta_window_x11_is_ssd (window))
|
||||||
{
|
{
|
||||||
meta_window_x11_set_frame_xwindow (window,
|
meta_window_x11_set_frame_xwindow (window,
|
||||||
event->xmaprequest.window);
|
event->xmaprequest.window);
|
||||||
|
@ -133,4 +133,7 @@ void meta_window_x11_group_leader_changed (MetaWindow *window);
|
|||||||
|
|
||||||
void meta_window_x11_set_frame_xwindow (MetaWindow *window,
|
void meta_window_x11_set_frame_xwindow (MetaWindow *window,
|
||||||
Window xframe);
|
Window xframe);
|
||||||
|
|
||||||
|
gboolean meta_window_x11_is_ssd (MetaWindow *window);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -2035,6 +2035,13 @@ meta_window_x11_set_transient_for (MetaWindow *window,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_window_x11_is_ssd (MetaWindow *window)
|
||||||
|
{
|
||||||
|
/* Will be updated in the next commits once frame field is moved to WindowX11 */
|
||||||
|
return window->frame != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_window_x11_constructed (GObject *object)
|
meta_window_x11_constructed (GObject *object)
|
||||||
{
|
{
|
||||||
@ -2404,7 +2411,7 @@ meta_window_x11_update_input_region (MetaWindow *window)
|
|||||||
|
|
||||||
if (window->decorated)
|
if (window->decorated)
|
||||||
{
|
{
|
||||||
if (!window->frame)
|
if (!meta_window_x11_is_ssd (window))
|
||||||
{
|
{
|
||||||
if (priv->input_region)
|
if (priv->input_region)
|
||||||
meta_window_set_input_region (window, NULL);
|
meta_window_set_input_region (window, NULL);
|
||||||
@ -2689,7 +2696,7 @@ meta_window_move_resize_request (MetaWindow *window,
|
|||||||
window->type);
|
window->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->decorated && !window->frame)
|
if (window->decorated && !meta_window_x11_is_ssd (window))
|
||||||
{
|
{
|
||||||
width = new_width;
|
width = new_width;
|
||||||
height = new_height;
|
height = new_height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user