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 Gtk4 #1364

Open
4 of 11 tasks
friday opened this issue Mar 3, 2024 · 0 comments
Open
4 of 11 tasks

support Gtk4 #1364

friday opened this issue Mar 3, 2024 · 0 comments
Labels
enhancement Improvement to an existing feature
Milestone

Comments

@friday
Copy link
Member

friday commented Mar 3, 2024

Description

A lot of APIs we depend on were removed in Gtk4

It is too early to even start investigating all that we would need to migrate. But these should be done before:

Preparations:

Migration:

  • Bump gi_versions for Gtk, Gdk to 4.0
  • Replace Gtk.IconTheme.get_default() w Gtk.IconTheme.get_for_display(display)?
  • Use new API for storing to clipboard (display.get_primary_clipboard().set_content(Gdk.ContentProvider.new_for_value(data))?)

I tried to rewrite the get_monitor method so that it used python-xlib. I managed to get the mouse coordinates:

from Xlib.display import Display
data = Display().screen().root.query_pointer()
# data.root_x and data.root_y 

However:

  1. I haven't found a replacement for display.get_monitor_at_point(x, y). It's possible that we can use data.child (window) to get the actual "Window" (or virtual window if there is no window under your pointer?) but that doesn't help. We need to calculate this: https://www.reddit.com/r/commandline/comments/nko6rw/how_can_i_get_the_current_monitor_on_which_a/ (this is also what get_monitor_at_point does in the source code).
  2. The coordinates we get differ from the coordinates we get from Gtk. The Gtk ones includes the scaling factor (so if your scaling factor is 2x, then the Gtk ones will be half of the Xlib ones. This might not be a problem though (since the replacement for we write for get_monitor_at_point likely won't either).

Communication guidelines

Ulauncher v6

  • I have checked and couldn't find my suggestion in v6.
@friday friday added the enhancement Improvement to an existing feature label Mar 3, 2024
@friday friday added this to the TBD milestone Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant