mirror of
https://github.com/elementary/gala.git
synced 2024-08-17 11:00:28 +03:00
WindowClone: Allow force kill with control modifier
This commit is contained in:
parent
ed9430f020
commit
5c8c3db2a8
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user