Closed salazarbarrera closed 1 year ago
Thanks for reporting the issue! The way Gnome handles modifier key code is nasty.. IIRC it is always the power of 2(e.g. 8 16 32 etc). This page may contain more details: https://wiki.archlinux.org/title/xmodmap For the Error "Gdk.Keymap is undefined", can you please check what GDK/GTK version is if it is in X11?
I'm not sure if this is what you are asking me, but here is the information I could gather
$ xdpyinfo
name of display: :0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 12011000
X.Org version: 1.20.11
That's the X.Org version. Since we are talking about Gnome 40.3, gnome-shell depends on gtk4 (current version: gtk4-1:4.2.1-2 ).
$ pacman -Qi gnome-shell|grep Depends
Depends On : accountsservice gcr gjs gnome-bluetooth upower gnome-session gtk4 gnome-settings-daemon gnome-themes-extra gsettings-desktop-schemas libcanberra-pulse libgdm libsecret mutter nm-connection-editor unzip gstreamer libibus gnome-autoar gnome-disk-utility gst-plugin-pipewire libmutter-8.so=0-64
But again, I'm not sure if that was what you were asking me.
Thanks. It seems that it is the Gtk4 rather than X11 that caused the issue given the info. Gnome40 is the first version adapting gtk4: https://www.zdnet.com/article/gnome-drops-3-x-versioning-to-shift-to-gnome-40-for-next-release/ I'm using ubuntu and the community seems to keep using Gnome38 and gtk3 for potential issue of new gtk4:https://www.linuxuprising.com/2021/04/how-to-install-gnome-40-on-ubuntu-2104.html#:~:text=Ubuntu%2021.04%2C%20which%20was%20released,is%20neither%20official%20nor%20stable.
I don't have a gnome40 environment currently, but may get some gnome40 VM to debug later or wait until ubuntu community introduces new Gnome version.. But please let me know if you have further findings about equivalence of Gdk.Keymap in GTK4 or a proper way to detect modifier key event in GTK4.
I haven't developed for gnome, so I'm not familiar with doing stuff with keys beyond modifying the already existing ones. BUT, here are the old and the new documentations of gtk4 on keyboard handling, maybe it can help you. I'll try to read more about the topic in case I can help you.
Edit: Also, gdk3 documentation recommends replacing get_default() with get_for_display(), apparently (because get_default was marked as deprecated since 3.22).
Thanks for the info! The get_for_display might be a quick fix. Please try it if you could. The shell extension code is located at ~/.local/share/gnome-shell/extensions/transparent-window@pbxqdown.github.com. Try modify it locally and reload extension.
Actually I did some exploration before on new GTK and found that they deprecated Keymap struct. The hard part is, i didn't find a suitable way to listen to modifer-press event and get key code, like Keymap struct did. For old GTK's Keymap struct, it can be connected with "state_changed" signal, and Keymap.get_modifier_state would get the key code. See: https://github.com/pbxqdown/gnome-shell-extension-transparent-window/blob/7ac02c501e1b82ba6a60d9f59477808976bf4c0c/extension.js#L155
so ... Is it fixed?
so ... Is it fixed?
The extension's main functionality works with latest gnome. If you are not able to edit modifier key by pressing the key, try use following modifer key code list to calculate hotkey code(E.g. Ctrl+Alt is 4 + 8 = 12): Shift 1 AltGr 2 Control 4 Alt 8 ShiftL 16 ShiftR 32 CtrlL 64 CtrlR 128 CapsShift 256 https://man7.org/linux/man-pages/man5/keymaps.5.html
It works with Gnome Shell v. 42.5
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 15 days since being marked as stale.
System information
$ gnome-extensions-app
and go to Transparent Window settings.Describe the problem
Extension works fine, but modifier can't be edited via GUI, only by modifying an integer key "/org/gnome/shell/extensions/TransparentWindow/modifier-key" on an empty schema. This is particularly hard because the extension doesn't use standard key codes (e.g. the value 8 doesn't represent backspace, but the left Alt key when Num Lock is off). This seems to be the same problem as #13, but it happens in X11, not only on Wayland as before.
Source code / logs
When one goes to settings, one is greeted by this error: