GNOME Bugzilla – Bug 757984
gtkimcontextsimple.c: Fix build on Windows
Last modified: 2017-08-05 23:51:24 UTC
Hi, In an update to gtkimcontextsimple.c to support compose tables for X11/Wayland, builds for non-X11 platforms, specifically those that do not have X11_PREFIX, are broken as some of those code are built unconditionally. I will attach a simple patch to ensure that those code are built only when on X11 or Wayland. With blessings, thank you!
Created attachment 315332 [details] [review] gtkimcontextsimple.c: Build compose table code only on X11 and Wayland Hi, Here goes the patch... With blessings, thank you!
Review of attachment 315332 [details] [review]: I'm not sure I agree entirely. Having a way to do custom shortcuts via a gtk-3.0/Compose file is useful on all platforms. Of course, the X11-specific pieces need to be ifdefed
Created attachment 315385 [details] [review] gtkimcontextsimple.c: Don't use hardcoded X11_PREFIX on non-X11 and non-Wayland builds Hello Matthias, (In reply to Matthias Clasen from comment #2) > I'm not sure I agree entirely. Having a way to do custom shortcuts via a > gtk-3.0/Compose file is useful on all platforms. Of course, the X11-specific > pieces need to be ifdefed Hmm, it does seem to me that the compose file items are run only when we are on Wayland or X11, as we check for the validity of the X11 or Wayland display (but not on the other display), so I would figure that the support for this on other platforms are either WIP or is not intended to be supported, but anyways... Here's the patch that looks up the data path for the compose file dynamically when we are not on X11 nor Wayland. With blessings, thank you!
(Sorry, the "on the other display" should read "on the other backends")
I had overlooked the code further down that only sets up the tables on X11 or Wayland. So, while I think that custom compose tables could be useful everywhere, we currently don't use them on other platforms.
This code is now compile-time dependant. If you run on OS X but compile with X support, you will get your Compose tables from X11_DATA_PREFIX, but if you build without X11 support, it's from g_get_datadir(). Same thing on Windows or with Wayland, though I don't think anyone builds Wayland support on Windows yet? In any case: Is that intended?