Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonas Dreßler
mutter
Commits
f25da803
Commit
f25da803
authored
May 19, 2022
by
Jonas Dreßler
Browse files
window: add can_grab
parent
99a2a038
Pipeline
#399435
waiting for manual action with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/core/display.c
View file @
f25da803
...
...
@@ -1926,6 +1926,9 @@ meta_display_begin_grab_op (MetaDisplay *display,
return
FALSE
;
}
if
(
!
grab_window
->
can_grab
)
return
FALSE
;
/* Grab keys when beginning window ops; see #126497 */
if
(
event_route
==
META_EVENT_ROUTE_WINDOW_OP
)
{
...
...
src/core/window-private.h
View file @
f25da803
...
...
@@ -427,6 +427,8 @@ struct _MetaWindow
/* Whether the window is alive */
guint
is_alive
:
1
;
unsigned
int
can_grab
:
1
;
/* if non-NULL, the bounds of the window frame */
cairo_region_t
*
frame_bounds
;
...
...
src/core/window.c
View file @
f25da803
...
...
@@ -1029,6 +1029,8 @@ _meta_window_shared_new (MetaDisplay *display,
meta_window_update_desc
(
window
);
window
->
override_redirect
=
attrs
->
override_redirect
;
if
(
window
->
override_redirect
)
g_warning
(
"WS: FFUUUUCK, it's an OR window"
);
/* avoid tons of stack updates */
meta_stack_freeze
(
window
->
display
->
stack
);
...
...
@@ -1173,6 +1175,8 @@ _meta_window_shared_new (MetaDisplay *display,
window
->
compositor_private
=
NULL
;
window
->
can_grab
=
TRUE
;
if
(
window
->
rect
.
width
>
0
&&
window
->
rect
.
height
>
0
)
window
->
monitor
=
meta_window_calculate_main_logical_monitor
(
window
);
else
...
...
@@ -8622,3 +8626,16 @@ meta_window_calculate_bounds (MetaWindow *window,
return
FALSE
;
}
}
void
meta_window_set_can_grab
(
MetaWindow
*
window
,
gboolean
can_grab
)
{
if
(
window
->
can_grab
==
can_grab
)
return
;
window
->
can_grab
=
can_grab
;
if
(
!
window
->
can_grab
&&
window
->
display
->
grab_window
==
window
)
meta_display_end_grab_op
(
window
->
display
,
meta_display_get_current_time_roundtrip
(
window
->
display
));
}
src/meta/window.h
View file @
f25da803
...
...
@@ -453,4 +453,8 @@ uint64_t meta_window_get_id (MetaWindow *window);
META_EXPORT
MetaWindowClientType
meta_window_get_client_type
(
MetaWindow
*
window
);
META_EXPORT
void
meta_window_set_can_grab
(
MetaWindow
*
window
,
gboolean
can_grab
);
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment