Skip to content

tadd/gnome-wayland-fix-window-op.so

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GNOME on Wayland: Fix gdk_window_* Operations

This preloaded library fixes some GTK3 window operations like gdk_window_raise to be effective with GNOME/Mutter on Wayland.

For example, you can use the elisp function raise-frame normally when you're using PGTK Emacs.

Scope

gdk_window_raise is the only function we can fix at this time. We plan to fix others using the same mechanism.

Requirements

GNOME extension Activate Window By Title needs to be installed.

Usage

  1. make.
  2. Launch any GTK3 application with LD_PRELOAD=$PWD/gnome-wayland-fix-window-op.so <yourappnamehere>.

Enjoy your ordinary and normal desktop life, and wait for the canonical specs and impls to remove this hack.

Tricks

LD_PRELOAD and D-Bus.

  1. Override a target function with our implementation with LD_LIBRARY.
  2. If we don't need to change its behavior, call the original function as is.
  3. Otherwise, call the D-Bus method activateByTitle with the window title taken from the target function's argument.

Development

https://github.com/tadd/gnome-wayland-fix-window-op.so

License

LGPL 2.1. See COPYING.md.

References

  • Satoru Takabayashi, Fumitoshi Ukai, Yusuke Sato, Shinichiro Hamaji, and Kazuyuki Shudo. Hack #61: Using "LD_PRELOAD" to wrap existing functions in Binary Hacks (in Japanese). O'Reilly Japan, pp 228-230, Nov. 2006.
  • Wondering why it doesn't work by default? Here is GTK 3.24's empty code.

About

Fix the window operation bugs with preloading/overriding.

Topics

Resources

License

Stars

Watchers

Forks