lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
963 stars 39 forks source link

[WaylandWindow] Unmap surface before sending activation request #118

Closed alebastr closed 7 months ago

alebastr commented 7 months ago

Not tested on Hyprland. Lightly tested on Sway.

Let's hope that everything that can happen after mode_result doesn't cause a redraw or is sufficiently protected against not having a surface. Asynchronous list updates, queued events, etc...

Fixes lbonn/rofi#117

lbonn commented 7 months ago

Nice, thanks a lot! After a quick test I think it works again with Hyprland.

I just added a small comment on the code organization, let me know what you think.

@LorenzoBettini do you fancy a test as well? :)

LorenzoBettini commented 7 months ago

@lbonn yes, I'd like to test it :) what would be the best way to do that?

lbonn commented 7 months ago

@LorenzoBettini

Then follow the instructions in https://github.com/lbonn/rofi/blob/wayland/INSTALL.md (only meson will work, not autotools)

eg meson setup build, ninja -C build ...

LorenzoBettini commented 7 months ago

@lbonn

here's what I've done:

sudo pacman -S meson

cd ~/tmp
git clone https://github.com/alebastr/rofi -b wayland-window-unmap
cd rofi
git submodule update --init

meson setup build
ninja -C build

build/rofi -version
Version: 1.7.5+wayland1-252-gc7472ecc (wayland-window-unmap)

Then I tried (with a few windows in separate hyprland workspaces):

build/rofi -show window

and selecting the window now correctly switches to it (in case, also switching to the corresponding workspaces).

Well done! :) And thanks for fixing it so fast!

lbonn commented 7 months ago

Great! Thanks for your help.

@alebastr is it fine by you if we merge this now?

alebastr commented 7 months ago

Thanks for testing!

@lbonn from a brief look, the only public method that touches the surface and does not check it is display_set_surface_dimensions. I guess if that becomes a problem, we could fix it later.

Feel free to merge.

kRHYME7 commented 7 months ago

Thanks!

kohane27 commented 7 months ago

Just want to show my appreciation that running paru -S rofi-lbonn-wayland-git works!

Thank you for fixing it! I really appreciate it!

LorenzoBettini commented 7 months ago

Thanks again! Are you going to release this version?

lbonn commented 7 months ago

@LorenzoBettini true, maybe not a bad idea. There have been quite a few fixes since last version.