Skip to content

Commit c5356d9

Browse files
committed
Merge branch 'lenemter/cleanup-delegate-actor' of https://github.com/elementary/gala into lenemter/cleanup-delegate-actor
2 parents b2b937f + c9d570b commit c5356d9

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

data/gala.gschema.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</description>
6363
</key>
6464
<key type="s" name="panel-main-menu-action">
65-
<default>''</default>
65+
<default>'io.elementary.wingpanel --toggle-indicator=app-launcher'</default>
6666
<summary>Panel main menu action</summary>
6767
<description>Sets the command to run when the panel-main-menu keybinding is pressed.</description>
6868
</key>
@@ -72,10 +72,15 @@
7272
<description></description>
7373
</key>
7474
<key type="s" name="overlay-action">
75-
<default>''</default>
75+
<default>'io.elementary.wingpanel --toggle-indicator=app-launcher'</default>
7676
<summary></summary>
7777
<description></description>
7878
</key>
79+
<key type="s" name="interactive-screenshot-action">
80+
<default>'flatpak run io.elementary.screenshot'</default>
81+
<summary>Interactive screenshot action</summary>
82+
<description>Sets the command to run when the interactive-screenshot keybinding is pressed.</description>
83+
</key>
7984
<key type="b" name="move-maximized-workspace">
8085
<default>false</default>
8186
<summary>Automatically move maximized windows to a new workspace</summary>
@@ -144,6 +149,10 @@
144149
<default><![CDATA[['Print']]]></default>
145150
<summary>Take a screenshot</summary>
146151
</key>
152+
<key name="interactive-screenshot" type="as">
153+
<default><![CDATA[['<Super>Print']]]></default>
154+
<summary>Launch the interactive screenshot tool</summary>
155+
</key>
147156
<key name="window-screenshot" type="as">
148157
<default><![CDATA[['<Alt>Print']]]></default>
149158
<summary>Take a screenshot of a window</summary>

src/WindowManager.vala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ namespace Gala {
255255
display.add_keybinding ("switch-input-source-backward", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_switch_input_source);
256256

257257
display.add_keybinding ("screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
258+
display.add_keybinding ("interactive-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
258259
display.add_keybinding ("window-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
259260
display.add_keybinding ("area-screenshot", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
260261
display.add_keybinding ("screenshot-clip", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, (Meta.KeyHandlerFunc) handle_screenshot);
@@ -410,10 +411,12 @@ namespace Gala {
410411
private void launch_action (string action_key) {
411412
try {
412413
var action = behavior_settings.get_string (action_key);
413-
if (action != null && action != "") {
414+
if (action != null) {
414415
Process.spawn_command_line_async (action);
415416
}
416-
} catch (Error e) { warning (e.message); }
417+
} catch (Error e) {
418+
warning (e.message);
419+
}
417420
}
418421

419422
private void on_monitors_changed () {
@@ -516,6 +519,9 @@ namespace Gala {
516519
case "screenshot":
517520
screenshot_screen.begin ();
518521
break;
522+
case "interactive-screenshot":
523+
launch_action ("interactive-screenshot-action");
524+
break;
519525
case "area-screenshot":
520526
screenshot_area.begin ();
521527
break;
@@ -1045,13 +1051,7 @@ namespace Gala {
10451051
current.@delete (Gtk.get_current_event_time ());
10461052
break;
10471053
case ActionType.OPEN_LAUNCHER:
1048-
try {
1049-
Process.spawn_command_line_async (
1050-
behavior_settings.get_string ("panel-main-menu-action")
1051-
);
1052-
} catch (Error e) {
1053-
warning (e.message);
1054-
}
1054+
launch_action ("panel-main-menu-action");
10551055
break;
10561056
case ActionType.WINDOW_OVERVIEW:
10571057
if (window_overview == null) {

0 commit comments

Comments
 (0)