cerebroapp / cerebro

🔵 Cerebro is an open-source launcher to improve your productivity and efficiency
https://www.cerebroapp.com/
MIT License
8.32k stars 454 forks source link

Window resizing no longer works in Linux #287

Open mmabey opened 7 years ago

mmabey commented 7 years ago

Issue

I know this is related to issue #151, but I believe it is a separate problem.

I just upgraded to v0.2.8 (even though the version command in Cerebro prints 0.2.7) in Linux using the .deb download, and window resizing stopped working immediately after upgrading. I believe that the version I had before was 0.2.7 since it wasn't that long ago that I updated, but I can't be sure since I deleted the previous .deb long ago.

The observed behavior is that when I place my mouse over the corner or side edges, the cursor changes to indicate it is within the "resize zone", but when I click and drag nothing happens. I'm not drunk and I don't have any medical conditions that make my hands shake, so I'm pretty sure it's not something I'm doing wrong.

I have tried restarting Cerebro as well as re-downloading the .deb and reinstalling Cerebro, but I still get the same results. I've confirmed that I can still resize the windows of other programs, so I don't think it's an OS issue.

maximbaz commented 7 years ago

I can think of one change that might have caused it: #263

I don't repro your issue on arch+i3, and I do like the change in #263, but I wonder if Mint handles splash windows in such special way that prevents resizing them.

/cc @Enzime

Enzime commented 7 years ago

Can someone confirm that being able to resize the Cerebro window is intended? I also run Arch and i3, so when I test with the old version (pre-splash change) it does create a window but one without borders, so it cannot be resized in i3, I'm not too sure about in other WM/DE setups though.

glja021 commented 7 years ago

I did some testing on Ubuntu 16.10/Gnome 3.22 & Debian 8.7/Cinnamon 2.2, neither one can be resized or moved with the 0.2.8 version, it might be the way Gnome handles floating windows.

Not sure if is intended to be resizable though, personally I don't mind having a fixed size but it wasn't the default behavior on past versions.

maximbaz commented 7 years ago

It would be a pity to revert splash change, Cerebro is floating window by its nature, I was using some hooks before #263 to forcefully mark it as floating.


offtopic: @Enzime, to resize any floating window in i3, with or without borders, you can use floating_modifier 😉 So really in i3 pre-splash and post-splash both can be resized identically.

Enzime commented 7 years ago

@maximbaz yeah, I already knew this, I was just confirming the intended behaviour, because normally if a window doesn't have borders in i3 this implies that it shouldn't be resized regardless of window manager.

Rather than revert the splash change, we could just make a new settings option that allows the user to specify the window type, and have some note in the documentation/README for floating window manager users :)

maximbaz commented 7 years ago

I don't think having an option for window type is a good idea, we wouldn't expect regular users of this app to know what window type even is. If you agree that Cerebro is a floating window by its nature, we should keep it floating.

I'd rather focus on Gnome's handling of floating windows, (1) to check that it in fact prevents any other floating window to be resized, and (2) what does Gnome community suggest for resizing floating windows (it is either a bug, or there is an explanation on why it is what it is).

Enzime commented 7 years ago

@maximbaz I think having an advanced option is fine as long as it's just documented, but doesn't show up in the UI, anyone who wants to modify it should just be encouraged to edit the config file themselves. Also if possible, make it default to the previous default, and it only appears in the config file if the user specifies it.

maximbaz commented 7 years ago

If I had to override Cerebro's window type and make it floating, I would just use .i3/config, like I was doing before #263.

for_window [class="Cerebro"] floating enable

However, I still believe Cerebro is a floating window in its nature, and I consider #263 as a valid bug fix. If Gnome cannot handle floating windows, I'd rather complain to Gnome 🙂

Just saying, if we end up reverting #263, I would just fallback to the hook in .i3/config and not use any other advanced options in the Cerebro itself.

KELiON commented 7 years ago

Can you please explain a bit more about details of splash and not splash window? I can only say:

maximbaz commented 7 years ago

My understanding is the following: a window can be of a "normal" or a "floating" type. Different OS and different window managers may handle such windows differently.

The conceptual difference is best spotted in tiling window managers, where "normal" windows consume their own space on the screen and are not allowed to overlap each other, but "floating" windows are allowed, well, to float above other windows.

Earlier Cerebro was of a "normal" type, which meant that me, @Enzime and other users of tiling window managers saw Cerebro consuming space like an independent window, like so:

image

This is pretty ugly for a default behavior. What we wanted instead is to allow Cerebro to float above open windows, and not consume its own space, like so:

image

I used external tools to override Cerebro's window type and force it to be floating. @Enzime discovered, that when Electron's window is defined with splash type, besides all things this does it makes Cerebro floating - that is the reasoning for #263, much better default experience for users of tiling window managers, and no external hacks are required.

However, as we learned in this thread, a particular desktop environment, Gnome, treats "floating" (or "splash"?) windows in a weird way, and does not allow to resize them.

We don't know if Gnome treats all "floating" windows like that, or Electron's splash type makes something else, which causes this behavior. This would be nice to find out, as we would know if the problem is with splash type, or with all "floating" windows in general.

If the problem is with splash type, we just find another way to make Cerebro "floating". If the problem is with all "floating" windows, I guess we should revert #263, as Gnome is quite popular, and too many people would not be able to benefit from plugins like maps / devdocs / stackoverflow without resizing the window.

mmabey commented 7 years ago

Just as an additional data point, I've confirmed that this is still an issue with version 0.3.0.

mccompunerd commented 2 years ago

I know this is an old issue, but I'm still seeing the exact same thing on Linux Mint 20.3 on Cinnamon 5.2.7 Cerebro.app version: 0.5.0 appimage and installed from .deb.