Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: minimize (hide) on focus-out #14

Merged
merged 2 commits into from
Jun 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
If minimize on focus-out is enabled, register the callback once the a…
…nimation is done
  • Loading branch information
eaon committed Jun 21, 2020
commit f274b087bede581d49b2d2c89b9d060e9b063586
9 changes: 8 additions & 1 deletion quake-mode@repsac-by.github.com/quakemodeapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ var QuakeModeApp = class {

get height() { return this.settings.get_int('quake-mode-height'); }

get focusout() { return this.settings.get_boolean('quake-mode-focusout'); }

get ainmation_time() { return this.settings.get_double('quake-mode-animation-time'); }

get monitor() {
Expand Down Expand Up @@ -175,14 +177,16 @@ var QuakeModeApp = class {
}

show() {
const { actor } = this;
const { actor, focusout } = this;

if ( this.state !== state.RUNNING )
return;

if ( Tweener.isTweening(actor) )
return;

const quake = this;

Tweener.addTween(actor, {
translation_y: 0,
clip_y: 0,
Expand All @@ -197,6 +201,9 @@ var QuakeModeApp = class {
this.remove_clip();
Main.wm.skipNextEffect(this);
Main.activateWindow(this.meta_window);
if ( focusout )
once(global.display, 'notify::focus-window')
.then(() => quake.hide());
},
});
}
Expand Down