WindowClone: Allow force kill with control modifier

This commit is contained in:
Leonhard Kargl 2024-07-11 21:20:48 +02:00
parent ed9430f020
commit 5c8c3db2a8
2 changed files with 9 additions and 5 deletions

View File

@ -74,7 +74,7 @@ namespace Gala {
*
* @param button The button which was pressed
*/
public signal void actor_clicked (uint32 button);
public signal void actor_clicked (uint32 button, bool control_modifier);
/**
* The type of the action
@ -229,7 +229,7 @@ namespace Gala {
// release has happened within bounds of actor
if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) {
actor_clicked (event.get_button ());
actor_clicked (event.get_button (), event.has_control_modifier ());
}
if (clicked) {

View File

@ -117,7 +117,7 @@ public class Gala.WindowClone : Clutter.Actor {
if (overview_mode) {
var click_action = new Clutter.ClickAction ();
click_action.clicked.connect ((action, actor) => {
actor_clicked (action.get_button ());
actor_clicked (action.get_button (), CONTROL_MASK in action.get_state ());
});
add_action (click_action);
@ -612,13 +612,17 @@ public class Gala.WindowClone : Clutter.Actor {
destroy ();
}
private void actor_clicked (uint32 button) {
private void actor_clicked (uint32 button, bool control_modifier) {
switch (button) {
case Clutter.Button.PRIMARY:
selected ();
break;
case Clutter.Button.MIDDLE:
close_window (wm.get_display ().get_current_time ());
if (control_modifier) {
window.kill ();
} else {
close_window (wm.get_display ().get_current_time ());
}
break;
}
}