weston-wfits: check output->make equal weston-X11 too upstream
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 16 Sep 2014 20:03:15 +0000 (13:03 -0700)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 16 Sep 2014 20:03:15 +0000 (13:03 -0700)
Weston changed the output->make for the x11-compositor from
xwayland to weston-X11:

http://cgit.freedesktop.org/wayland/weston/commit/?id=22e16b656f67ee577e32a7af91f443840fc3aee1

For uinput emulation on x11 backend, we need to check whether
output->make is either weston-X11 or xwayland (for backwards
compat) now.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/extensions/weston/input-emulator-uinput.cpp

index ee72878..9732d6e 100644 (file)
@@ -124,7 +124,8 @@ static void screenSize(int32_t *width, int32_t *height)
 {
        struct weston_output *output(Globals::output());
 
-       if (std::string(output->make) == "xwayland") {
+       std::string make(output->make);
+       if (make == "xwayland" or make == "weston-X11") {
 #if defined(HAVE_X11_SUPPORT)
                struct x11_compositor *x11_compositor = (struct x11_compositor*) Globals::compositor();
                *width = x11_compositor->screen->width_in_pixels;
@@ -165,7 +166,8 @@ static void toScreen(int32_t *x, int32_t *y)
 
        toDevice(x, y);
 
-       if (std::string(output->make) == "xwayland") {
+       std::string make(output->make);
+       if (make == "xwayland" or make == "weston-X11") {
 #if defined(HAVE_X11_SUPPORT)
                struct x11_compositor *x11_compositor = (struct x11_compositor*)Globals::compositor();
                struct x11_output *x11_output = (struct x11_output*) output;
@@ -211,7 +213,8 @@ InputEmulatorUInput::InputEmulatorUInput()
        weston_log("weston-wfits: %s\n", BOOST_CURRENT_FUNCTION);
 
 #ifndef HAVE_X11_SUPPORT
-       assert(std::string(Globals::output()->make) != "xwayland");
+       std::string make(Globals::output()->make);
+       assert(make != "xwayland" and make != "weston-X11");
 #endif
        assert(not Globals::isHeadless());