Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ namespace Gala {
* to end your modal mode again with {@link WindowManager.pop_modal}
*/
public class ModalProxy : Object {
public Clutter.Grab? grab { get; set; }
public Clutter.Actor actor { get; construct; }
public bool should_grab { get; construct; }
public Clutter.Grab? grab { get; construct set; }

private GestureAction[] allowed_actions;

Expand All @@ -52,7 +54,8 @@ namespace Gala {
_keybinding_filter = filter;
}

public ModalProxy () {
public ModalProxy (Clutter.Actor actor, bool should_grab, Clutter.Grab? grab) {
Object (actor: actor, should_grab: should_grab, grab: grab);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Widgets/MultitaskingView/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ public class Gala.MultitaskingView : ActorTarget, RootTarget, ActivatableCompone

switch (binding.get_name ()) {
case "screenshot":
case "area-screenshot":
case "interactive-screenshot":
case "screenshot-clip":
case "area-screenshot-clip":
return false;
default:
break;
Expand Down
5 changes: 5 additions & 0 deletions src/Widgets/WindowOverview.vala
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent

switch (binding.get_name ()) {
case "expose-all-windows":
case "screenshot":
case "area-screenshot":
case "interactive-screenshot":
case "screenshot-clip":
case "area-screenshot-clip":
return false;
default:
break;
Expand Down
16 changes: 11 additions & 5 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,14 @@ namespace Gala {
* {@inheritDoc}
*/
public ModalProxy push_modal (Clutter.Actor actor, bool grab) {
var proxy = new ModalProxy ();
var current_proxy = modal_stack.peek_head ();
if (current_proxy.grab != null) {
current_proxy.grab.dismiss ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm IIRC clutter stacks the grabs internally already so why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... It was a bit broken when I tested it on older mutter but now it works fine. Thanks for letting me know!

}

modal_stack.offer_head (proxy);
var proxy = new ModalProxy (actor, grab, grab ? stage.grab (actor) : null);

if (grab) {
proxy.grab = stage.grab (actor);
}
modal_stack.offer_head (proxy);

on_focus_window_changed ();

Expand Down Expand Up @@ -681,6 +682,11 @@ namespace Gala {

on_focus_window_changed ();

var new_active_proxy = modal_stack.peek_head ();
if (new_active_proxy.should_grab) {
new_active_proxy.grab = stage.grab (new_active_proxy.actor);
}

if (is_modal ()) {
return;
}
Expand Down