Skip to content

Commit b299641

Browse files
mmstickjackpot51
authored andcommitted
feat: Add fullscreen launcher pref
1 parent 83cf486 commit b299641

File tree

4 files changed

+70
-38
lines changed

4 files changed

+70
-38
lines changed

schemas/org.gnome.shell.extensions.pop-shell.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<summary>Show a hint around the active window</summary>
88
</key>
99

10+
<key type="b" name="fullscreen-launcher">
11+
<default>false</default>
12+
<summary>Allow showing launcher above fullscreen windows</summary>
13+
</key>
14+
1015
<key type="u" name="gap-inner">
1116
<default>2</default>
1217
<summary>Gap between tiled windows</summary>

src/launcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ export class Launcher extends search.Search {
298298
ext.tiler.exit(ext);
299299

300300
// Do not allow opening twice
301+
if (this.opened) return
302+
301303
// Do not activate if the focused window is fullscreen
302-
if (this.opened || ext.focus_window()?.meta.is_fullscreen()) {
303-
return
304-
}
304+
if (!ext.settings.fullscreen_launcher() && ext.focus_window()?.meta.is_fullscreen()) return
305305

306306
this.opened = true
307307

src/prefs.ts

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import * as settings from 'settings';
1212
import * as log from 'log';
1313

1414
interface AppWidgets {
15+
fullscreen_launcher: any,
1516
inner_gap: any,
17+
mouse_cursor_follows_active_window: any,
1618
outer_gap: any,
19+
show_skip_taskbar: any,
1720
smart_gaps: any,
1821
snap_to_grid: any,
1922
window_titles: any,
20-
show_skip_taskbar: any,
21-
mouse_cursor_follows_active_window: any,
2223
}
2324

2425
// @ts-ignore
@@ -77,73 +78,90 @@ function settings_dialog_new(): Gtk.Container {
7778
Settings.sync();
7879
});
7980

81+
app.fullscreen_launcher.set_active(ext.fullscreen_launcher())
82+
app.fullscreen_launcher.connect('state-set', (_widget: any, state: boolean) => {
83+
ext.set_fullscreen_launcher(state)
84+
Settings.sync()
85+
})
86+
8087
return grid;
8188
}
8289

8390
function settings_dialog_view(): [AppWidgets, Gtk.Container] {
84-
let grid = new Gtk.Grid({
91+
const grid = new Gtk.Grid({
8592
column_spacing: 12,
8693
row_spacing: 12,
8794
margin_start: 10,
8895
margin_end: 10,
8996
margin_bottom: 10,
9097
margin_top: 10,
91-
});
98+
})
9299

93-
let win_label = new Gtk.Label({
100+
const win_label = new Gtk.Label({
94101
label: "Show Window Titles",
95102
xalign: 0.0,
96103
hexpand: true
97-
});
104+
})
98105

99-
let snap_label = new Gtk.Label({
106+
const snap_label = new Gtk.Label({
100107
label: "Snap to Grid (Floating Mode)",
101108
xalign: 0.0
102-
});
109+
})
103110

104-
let smart_label = new Gtk.Label({
111+
const smart_label = new Gtk.Label({
105112
label: "Smart Gaps",
106113
xalign: 0.0
107-
});
114+
})
108115

109-
let show_skip_taskbar_label = new Gtk.Label({
116+
const show_skip_taskbar_label = new Gtk.Label({
110117
label: "Show Minimize to Tray Windows",
111118
xalign: 0.0
112-
});
119+
})
113120

114-
let mouse_cursor_follows_active_window_label = new Gtk.Label({
121+
const mouse_cursor_follows_active_window_label = new Gtk.Label({
115122
label: "Mouse Cursor Follows Active Window",
116123
xalign: 0.0
117-
});
118-
119-
let window_titles = new Gtk.Switch({ halign: Gtk.Align.END });
120-
let snap_to_grid = new Gtk.Switch({ halign: Gtk.Align.END });
121-
let smart_gaps = new Gtk.Switch({ halign: Gtk.Align.END });
122-
let show_skip_taskbar = new Gtk.Switch({ halign: Gtk.Align.END });
123-
let mouse_cursor_follows_active_window = new Gtk.Switch({ halign: Gtk.Align.END });
124+
})
124125

125-
grid.attach(win_label, 0, 0, 1, 1);
126-
grid.attach(window_titles, 1, 0, 1, 1);
126+
const fullscreen_launcher_label = new Gtk.Label({
127+
label: "Allow launcher over fullscreen window",
128+
xalign: 0.0
129+
})
127130

128-
grid.attach(snap_label, 0, 1, 1, 1);
129-
grid.attach(snap_to_grid, 1, 1, 1, 1);
131+
const [inner_gap, outer_gap] = gaps_section(grid, 7);
132+
133+
const settings = {
134+
inner_gap,
135+
outer_gap,
136+
fullscreen_launcher: new Gtk.Switch({ halign: Gtk.Align.END }),
137+
smart_gaps: new Gtk.Switch({ halign: Gtk.Align.END }),
138+
snap_to_grid: new Gtk.Switch({ halign: Gtk.Align.END }),
139+
window_titles: new Gtk.Switch({ halign: Gtk.Align.END }),
140+
show_skip_taskbar: new Gtk.Switch({ halign: Gtk.Align.END }),
141+
mouse_cursor_follows_active_window: new Gtk.Switch({ halign: Gtk.Align.END })
142+
}
130143

131-
grid.attach(smart_label, 0, 2, 1, 1);
132-
grid.attach(smart_gaps, 1, 2, 1, 1);
144+
grid.attach(win_label, 0, 0, 1, 1)
145+
grid.attach(settings.window_titles, 1, 0, 1, 1)
133146

134-
grid.attach(show_skip_taskbar_label, 0, 3, 1, 1);
135-
grid.attach(show_skip_taskbar, 1, 3, 1, 1);
147+
grid.attach(snap_label, 0, 1, 1, 1)
148+
grid.attach(settings.snap_to_grid, 1, 1, 1, 1)
136149

137-
grid.attach(mouse_cursor_follows_active_window_label, 0, 4, 1, 1);
138-
grid.attach(mouse_cursor_follows_active_window, 1, 4, 1, 1);
150+
grid.attach(smart_label, 0, 2, 1, 1)
151+
grid.attach(settings.smart_gaps, 1, 2, 1, 1)
139152

140-
logging_combo(grid, 5);
153+
grid.attach(fullscreen_launcher_label, 0, 3, 1, 1)
154+
grid.attach(settings.fullscreen_launcher, 1, 3, 1, 1)
141155

142-
let [inner_gap, outer_gap] = gaps_section(grid, 6);
156+
grid.attach(show_skip_taskbar_label, 0, 4, 1, 1)
157+
grid.attach(settings.show_skip_taskbar, 1, 4, 1, 1)
143158

144-
let settings = { inner_gap, outer_gap, smart_gaps, snap_to_grid, window_titles, show_skip_taskbar, mouse_cursor_follows_active_window };
159+
grid.attach(mouse_cursor_follows_active_window_label, 0, 5, 1, 1)
160+
grid.attach(settings.mouse_cursor_follows_active_window, 1, 5, 1, 1)
145161

146-
return [settings, grid];
162+
logging_combo(grid, 6)
163+
164+
return [settings, grid]
147165
}
148166

149167
function gaps_section(grid: any, top: number): [any, any] {
@@ -204,7 +222,7 @@ function logging_combo(grid: any, top_index: number) {
204222
log_combo.set_active_id(`${current_log_level}`);
205223
log_combo.connect("changed", () => {
206224
let activeId = log_combo.get_active_id();
207-
225+
208226
let settings = ExtensionUtils.getSettings();
209227
settings.set_uint('log-level', activeId);
210228
});

src/settings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function settings_new_schema(schema: string): Settings {
5050
const ACTIVE_HINT = "active-hint";
5151
const COLUMN_SIZE = "column-size";
5252
const EDGE_TILING = "edge-tiling";
53+
const FULLSCREEN_LAUNCHER = "fullscreen-launcher"
5354
const GAP_INNER = "gap-inner";
5455
const GAP_OUTER = "gap-outer";
5556
const ROW_SIZE = "row-size";
@@ -83,6 +84,10 @@ export class ExtensionSettings {
8384
return this.mutter ? this.mutter.get_boolean("dynamic-workspaces") : false;
8485
}
8586

87+
fullscreen_launcher(): boolean {
88+
return this.ext.get_boolean(FULLSCREEN_LAUNCHER)
89+
}
90+
8691
gap_inner(): number {
8792
return this.ext.get_uint(GAP_INNER);
8893
}
@@ -171,6 +176,10 @@ export class ExtensionSettings {
171176
this.mutter?.set_boolean(EDGE_TILING, enable)
172177
}
173178

179+
set_fullscreen_launcher(enable: boolean) {
180+
this.ext.set_boolean(FULLSCREEN_LAUNCHER, enable)
181+
}
182+
174183
set_gap_inner(gap: number) {
175184
this.ext.set_uint(GAP_INNER, gap);
176185
}

0 commit comments

Comments
 (0)