Skip to content

Commit 52b234e

Browse files
mmstickjackpot51
authored andcommitted
fix: Avoid resetting launcher on window focus
1 parent 021c931 commit 52b234e

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/extension.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ export class Ext extends Ecs.System<ExtEvent> {
776776

777777
/** Triggered when a window has been focused */
778778
on_focused(win: Window.ShellWindow) {
779-
this.exit_modes();
780779
this.size_signals_unblock(win);
781780

782781
if (this.exception_selecting) {
@@ -1110,12 +1109,12 @@ export class Ext extends Ecs.System<ExtEvent> {
11101109

11111110
w_ratio = next_area.width / prev_area.width;
11121111
rect.width = rect.width * w_ratio;
1113-
1112+
11141113
if (next_area.x < prev_area.x) {
11151114
rect.x = ((next_area.x + rect.x - prev_area.x) / prev_area.width) * next_area.width;
11161115
} else if (next_area.x > prev_area.x) {
11171116
rect.x = ((rect.x / prev_area.width) * next_area.width) + next_area.x;
1118-
}
1117+
}
11191118

11201119
if (next_area.y < prev_area.y) {
11211120
rect.y = ((next_area.y + rect.y - prev_area.y) / prev_area.height) * next_area.height;
@@ -1135,10 +1134,10 @@ export class Ext extends Ecs.System<ExtEvent> {
11351134
win.move(this, rect, () => {}, false);
11361135
// if the resulting dimensions of rect == next
11371136
if (rect.width == next_area.width && rect.height == next_area.height) {
1138-
win.meta.maximize(Meta.MaximizeFlags.BOTH)
1137+
win.meta.maximize(Meta.MaximizeFlags.BOTH)
11391138
}
11401139
}
1141-
}
1140+
}
11421141
}
11431142

11441143
move_monitor(direction: Meta.DisplayDirection) {
@@ -1792,7 +1791,7 @@ export class Ext extends Ecs.System<ExtEvent> {
17921791
if (screenShield?.locked) this.update_display_configuration(false);
17931792

17941793
this.connect(display, 'notify::focus-window', () => {
1795-
const window = this.get_window(display.get_focus_window())
1794+
const window = this.get_window(display.get_focus_window())
17961795
if (window) this.on_focused(window)
17971796
return false
17981797
});
@@ -2393,7 +2392,7 @@ export class Ext extends Ecs.System<ExtEvent> {
23932392

23942393
is_floating(window: Window.ShellWindow): boolean {
23952394
let shall_float: boolean = false;
2396-
let wm_class = window.meta.get_wm_class();
2395+
let wm_class = window.meta.get_wm_class();
23972396
let wm_title = window.meta.get_title();
23982397

23992398
if (wm_class && wm_title) {
@@ -2404,7 +2403,7 @@ export class Ext extends Ecs.System<ExtEvent> {
24042403
let force_tiled_tagged = this.contains_tag(window.entity, Tags.ForceTile);
24052404
// Tags.Tiled does not seem to matter, so not checking here
24062405

2407-
return (floating_tagged && !force_tiled_tagged) ||
2406+
return (floating_tagged && !force_tiled_tagged) ||
24082407
(shall_float && !force_tiled_tagged);
24092408
}
24102409
}
@@ -2551,28 +2550,28 @@ let default_getcaption_windowpreview: any;
25512550
let default_getcaption_workspace: any;
25522551

25532552
/**
2554-
* Decorates the default gnome-shell workspace/overview handling
2553+
* Decorates the default gnome-shell workspace/overview handling
25552554
* of skip_task_bar. And have those window types included in pop-shell.
25562555
* Should only be called on extension#enable()
2557-
*
2558-
* NOTE to future maintainer:
2556+
*
2557+
* NOTE to future maintainer:
25592558
* Skip taskbar has been left out by upstream for a reason. And the
25602559
* Shell.WindowTracker seems to skip handling skip taskbar windows, so they are
2561-
* null or undefined. GNOME 40+ and lower version checking should be done to
2560+
* null or undefined. GNOME 40+ and lower version checking should be done to
25622561
* constantly support having them within pop-shell.
25632562
*
25642563
* Known skip taskbars ddterm, conky, guake, minimized to tray apps, etc.
25652564
*
2566-
* While minimize to tray are the target for this feature,
2567-
* skip taskbars that float/and avail workspace all
2565+
* While minimize to tray are the target for this feature,
2566+
* skip taskbars that float/and avail workspace all
25682567
* need to added to config.ts as default floating
25692568
*
25702569
*/
25712570
function _show_skip_taskbar_windows(ext: Ext) {
25722571
let cfg = ext.conf;
25732572
if (!GNOME_VERSION?.startsWith("40.")) {
2574-
// TODO GNOME 40 added a call to windowtracker and app var is not checked if null
2575-
// in WindowPreview._init(). Then new WindowPreview() is being called on
2573+
// TODO GNOME 40 added a call to windowtracker and app var is not checked if null
2574+
// in WindowPreview._init(). Then new WindowPreview() is being called on
25762575
// _addWindowClone() of workspace.js.
25772576
// So it has to be skipped being overriden for now.
25782577

@@ -2712,8 +2711,8 @@ function _show_skip_taskbar_windows(ext: Ext) {
27122711
* This is the cleanup/restore of the decorator for skip_taskbar when pop-shell
27132712
* is disabled.
27142713
* Should only be called on extension#disable()
2715-
*
2716-
* Default functions should be checked if they exist,
2714+
*
2715+
* Default functions should be checked if they exist,
27172716
* especially when skip taskbar setting was left on during an update
27182717
*
27192718
*/
@@ -2729,21 +2728,21 @@ function _hide_skip_taskbar_windows() {
27292728
} else {
27302729
if (default_getcaption_windowpreview) {
27312730
const { WindowPreview } = imports.ui.windowPreview;
2732-
WindowPreview.prototype._getCaption =
2731+
WindowPreview.prototype._getCaption =
27332732
default_getcaption_windowpreview;
27342733
}
27352734
}
27362735

27372736
if (default_isoverviewwindow_ws_thumbnail) {
2738-
WorkspaceThumbnail.prototype._isOverviewWindow =
2737+
WorkspaceThumbnail.prototype._isOverviewWindow =
27392738
default_isoverviewwindow_ws_thumbnail;
27402739
}
27412740

27422741
if (default_init_appswitcher)
27432742
AppSwitcher.prototype._init = default_init_appswitcher;
27442743

27452744
if (default_getwindowlist_windowswitcher) {
2746-
WindowSwitcherPopup.prototype._getWindowList =
2745+
WindowSwitcherPopup.prototype._getWindowList =
27472746
default_getwindowlist_windowswitcher;
27482747
}
27492748
}

0 commit comments

Comments
 (0)