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

support reposition popups #1974

Merged
merged 3 commits into from
Oct 25, 2023
Merged

support reposition popups #1974

merged 3 commits into from
Oct 25, 2023

Conversation

lilydjwg
Copy link
Contributor

@lilydjwg lilydjwg commented Oct 25, 2023

This implements xdg-shell v3. GTK 4 can use the reposition functionality to move its popups, which avoids flickering by the fallback way to hide and show popups.

This is especially useful since Wayfire doesn't fully implement the wayland input protocol and input methods resort to client side rendering.

(This patch is adapted from an earlier patch about which I don't remember many details, but it works.)

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks simple enough. Which clients use this functionality so that I can also test this?

src/view/xdg-shell.hpp Outdated Show resolved Hide resolved
@ammen99
Copy link
Member

ammen99 commented Oct 25, 2023

Oh I almost forgot .. there is a destroy() function where all of the wl_listeners need to be disconnected. Otherwise, you might get crashes in certain situations (destroying a popup with animation for example)

@lilydjwg
Copy link
Contributor Author

I'm using gnome-font-viewer and fcitx5 to test this.

  • install the fcitx5-im package group on Arch Linux and an input method, e.g. fcitx5-chinese-addons
  • add a Chinese input method in fcitx5-configtool
  • GTK_IM_MODULE=fcitx gnome-font-viewer
  • click the search icon to have an input box. activate fcitx5 (click tray icon if you don't know the key)
  • move the window to the right corner so that the space on the right isn't enough for fcitx5 to place its window
  • type something. you can see the fcitx5 window moves a bit as its size changes

Without this patch, the window will disappear and then re-appear frequently.

I don't know other applications affected actually. fcitx5 is the only reason I want this (but there aren't a lot of GTK 4 applications currently; Qt6 seems to still not having the support for reposition).

@ammen99
Copy link
Member

ammen99 commented Oct 25, 2023

Ok, this sounds a little bit difficult to test, I will trust that you have tested this ;) Thanks!

@ammen99 ammen99 merged commit e00495a into WayfireWM:master Oct 25, 2023
4 checks passed
@lilydjwg lilydjwg deleted the master branch October 27, 2023 04:36
ammen99 pushed a commit that referenced this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants