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

Some issues with i3 tiling WM. #270

Closed
kminehart opened this issue Mar 6, 2016 · 10 comments
Closed

Some issues with i3 tiling WM. #270

kminehart opened this issue Mar 6, 2016 · 10 comments

Comments

@kminehart
Copy link

I'm not using a DE, only the WM called "i3". See here: https://i3wm.org/

I think the issues might be because of the custom window borders and not allowing the WM to control the application? For example, I can't super+shift+q to exit, which executes kill. Clicking the X, fullscreen, or minimize does nothing either.

I'll see if I can do anything to help with this, I made a fork for my changes:

https://github.com/pascalsoftware/Google-Play-Music-Desktop-Player-UNOFFICIAL-

@kminehart
Copy link
Author

A note from i3s docs:

If an application does not provide a mechanism for closing (most applications provide a menu, the escape key or a shortcut like Control+w to close), you can press $mod+Shift+q to kill a window. For applications which support the WM_DELETE protocol, this will correctly close the application (saving any modifications or doing other cleanup). If the application doesn’t support the WM_DELETE protocol your X server will kill the window and the behaviour depends on the application.

However, using Control+W also does not kill the application.

@AnotherKamila
Copy link

Also seeing this in i3.

Additionally, if I switch to the miniplayer while in tiling mode, the window size is different than what the miniplayer expects, and it becomes very unhappy about this (constantly redrawing itself to the expected and actual size in a loop). As the miniplayer expects a fixed window size, probably telling the WM to float it is the most reasonable behavior (or you could make it resizable => me happy :D).

@kminehart
Copy link
Author

Update:
in src/index.js I added

    // Emitted when the user tries to close the application.
    mainWindow.on('close', () => {
      console.log('close');
    });

and when I make an attempt to close the application, either with super+shift+q, or with the x, or ctrl+w, the event gets fired and 'close' is printed on the console. At this point I'm not familiar enough with the application to correctly handle a close, but I'm working on it.

Default behavior is probably being prevented somewhere.

@kminehart
Copy link
Author

Here's the perpetrator:

So at the moment if anyone else is having this problem, make sure to disable "minimize to tray" in the desktop settings, then it should work fine! It looks like i3 and electron don't like to play nice when trying to hide a window, since i3 really has no way to hide a window.

mainWindow.on('close', (event) => {
  if ((Settings.get('minToTray', true) || process.platform === 'darwin') && !global.quiting) {
    if (process.platform !== 'darwin') {
      mainWindow.minimize();
      mainWindow.setSkipTaskbar(true);
    } else {
      if (PlaybackAPI.isPlaying()) {
        Emitter.sendToGooglePlayMusic('playback:playPause');
      }
      mainWindow.hide();
    }
    event.preventDefault();
    return;
  }

@AnotherKamila
Copy link

Yes, this works. BTW, other applications (e.g. VLC or Gajim) can "minimize" to tray in i3, but it is possible that they actually destroy the window.

@kminehart
Copy link
Author

Indeed, they would have to destroy the window. i3 does not technically have a way to minimize a window.

As for the issue at hand, I am unable to find a good fix for it. It would be easy, but Electron does not have window.minimizable implemented on Linux. I opened an issue here: electron/electron#4696

@MarshallOfSound
Copy link
Owner

Did some quick research into this it's definitely an electron bug and should be tracked there 👍

I'll watch the issue there and chime in if needed

@zetxx
Copy link

zetxx commented Oct 9, 2019

i think that this issue should be reopened. issue exists at current version

@tekjanson
Copy link

I am also having this issue with i3 on current build

@Block81838
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants