* [Qemu-devel] [PULL 0/4] Ui 20180410 patches
@ 2018-04-10 9:24 Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 1/4] ui: fix keymap detection under Xwayland Gerd Hoffmann
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-04-10 9:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
The following changes since commit 915d34c5f99b0ab91517c69f54272bfdb6ca2b32:
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-04-09 17:29:10 +0100)
are available in the git repository at:
git://git.kraxel.org/qemu tags/ui-20180410-pull-request
for you to fetch changes up to c6093a05d6a84d2144bb6462cf20e907eddf8aeb:
configure: don't warn SDL abi if disabled (2018-04-10 11:22:03 +0200)
----------------------------------------------------------------
configure: don't warn on old sdl/gtk versions if disabled.
keymap + gtk fixes.
----------------------------------------------------------------
Daniel P. Berrangé (1):
ui: fix keymap detection under Xwayland
Gerd Hoffmann (1):
gtk: drop pointless code from gd_window_close
Peter Xu (2):
configure: don't warn GTK if disabled
configure: don't warn SDL abi if disabled
configure | 110 +++++++++++++++++++++++++++++++---------------------------
ui/gtk.c | 8 -----
ui/x_keymap.c | 7 ++--
3 files changed, 63 insertions(+), 62 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 1/4] ui: fix keymap detection under Xwayland
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
@ 2018-04-10 9:24 ` Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 2/4] gtk: drop pointless code from gd_window_close Gerd Hoffmann
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-04-10 9:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Daniel P. Berrangé
From: Daniel P. Berrangé <berrange@redhat.com>
The X11 code currently detects the keymap by looking for the keycode
name property. Unfortunately due to the way Xwayland handles keyboards,
this property gets unset almost immediately after the first application
starts using Xwayland resulting in
** (qemu-system-x86_64:19644): WARNING **: Unknown X11 keycode mapping '(unnamed)'.
Please report to qemu-devel@nongnu.org
including the following information:
- Operating system
- X11 Server
- xprop -root
- xdpyinfo
Fortunately people will only see this problem if they built QEMU with
GTK2, or have told GTK3 to prefer X11 by setting the GDK_BACKEND=x11
env variable.
To workaround the problem, we add a heuristic that looks at what
scancode the XK_Page_Up keysymbol maps to, to determine if we've
likely got the X11 kbd or evdev driver.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20180313104235.20725-1-berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/x_keymap.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ui/x_keymap.c b/ui/x_keymap.c
index 22e0e77c4d..2bc01432e5 100644
--- a/ui/x_keymap.c
+++ b/ui/x_keymap.c
@@ -17,6 +17,7 @@
#include "ui/input.h"
#include <X11/XKBlib.h>
+#include <X11/Xutil.h>
static gboolean check_for_xwin(Display *dpy)
{
@@ -87,11 +88,13 @@ const guint16 *qemu_xkeymap_mapping_table(Display *dpy, size_t *maplen)
trace_xkeymap_keymap("xquartz");
*maplen = qemu_input_map_xorgxquartz_to_qcode_len;
return qemu_input_map_xorgxquartz_to_qcode;
- } else if (keycodes && g_str_has_prefix(keycodes, "evdev")) {
+ } else if ((keycodes && g_str_has_prefix(keycodes, "evdev")) ||
+ (XKeysymToKeycode(dpy, XK_Page_Up) == 0x70)) {
trace_xkeymap_keymap("evdev");
*maplen = qemu_input_map_xorgevdev_to_qcode_len;
return qemu_input_map_xorgevdev_to_qcode;
- } else if (keycodes && g_str_has_prefix(keycodes, "xfree86")) {
+ } else if ((keycodes && g_str_has_prefix(keycodes, "xfree86")) ||
+ (XKeysymToKeycode(dpy, XK_Page_Up) == 0x63)) {
trace_xkeymap_keymap("kbd");
*maplen = qemu_input_map_xorgkbd_to_qcode_len;
return qemu_input_map_xorgkbd_to_qcode;
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 2/4] gtk: drop pointless code from gd_window_close
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 1/4] ui: fix keymap detection under Xwayland Gerd Hoffmann
@ 2018-04-10 9:24 ` Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 3/4] configure: don't warn GTK if disabled Gerd Hoffmann
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-04-10 9:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Unregistering the display change listener looks like a pointless
excercise given we'll exit in a moment. When exiting qemu via
menu/file/quit this will not happen either. Just drop the code.
Also return TRUE unconditionally. This will tell gtk to ignore the
close request, so gtk will not start destroying widgets and causing
warnings due to UI code trying to talk to widgets which are gone.
Just depend on qmp_quit() doing it's job instead.
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20180314080439.4229-1-kraxel@redhat.com>
---
ui/gtk.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index e98ac4d2fc..bb3214cffb 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -786,21 +786,13 @@ static gboolean gd_window_close(GtkWidget *widget, GdkEvent *event,
{
GtkDisplayState *s = opaque;
bool allow_close = true;
- int i;
if (s->opts->has_window_close && !s->opts->window_close) {
allow_close = false;
}
if (allow_close) {
- for (i = 0; i < s->nb_vcs; i++) {
- if (s->vc[i].type != GD_VC_GFX) {
- continue;
- }
- unregister_displaychangelistener(&s->vc[i].gfx.dcl);
- }
qmp_quit(NULL);
- return FALSE;
}
return TRUE;
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 3/4] configure: don't warn GTK if disabled
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 1/4] ui: fix keymap detection under Xwayland Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 2/4] gtk: drop pointless code from gd_window_close Gerd Hoffmann
@ 2018-04-10 9:24 ` Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 4/4] configure: don't warn SDL abi " Gerd Hoffmann
2018-04-10 14:18 ` [Qemu-devel] [PULL 0/4] Ui 20180410 patches Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-04-10 9:24 UTC (permalink / raw)
To: qemu-devel
Cc: Gerd Hoffmann, Peter Xu, Paolo Bonzini, Peter Maydell, Fam Zheng,
Philippe Mathieu-Daudé
From: Peter Xu <peterx@redhat.com>
We don't need to detect GTK ABI if GTK is disabled in general.
Otherwise we could get this warning (when host is installed with GTK ABI
version 2) even when configure with "--disable-gtk":
WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Fam Zheng <famz@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180409082323.29575-1-peterx@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/configure b/configure
index 752dd9ef32..931d2a07cc 100755
--- a/configure
+++ b/configure
@@ -2540,19 +2540,18 @@ fi
##########################################
# GTK probe
-if test "$gtkabi" = ""; then
- # The GTK ABI was not specified explicitly, so try whether 3.0 is available.
- # Use 2.0 as a fallback if that is available.
- if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
- gtkabi=3.0
- elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
- gtkabi=2.0
- else
- gtkabi=3.0
- fi
-fi
-
if test "$gtk" != "no"; then
+ if test "$gtkabi" = ""; then
+ # The GTK ABI was not specified explicitly, so try whether 3.0 is available.
+ # Use 2.0 as a fallback if that is available.
+ if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
+ gtkabi=3.0
+ elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
+ gtkabi=2.0
+ else
+ gtkabi=3.0
+ fi
+ fi
gtkpackage="gtk+-$gtkabi"
gtkx11package="gtk+-x11-$gtkabi"
if test "$gtkabi" = "3.0" ; then
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PULL 4/4] configure: don't warn SDL abi if disabled
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
` (2 preceding siblings ...)
2018-04-10 9:24 ` [Qemu-devel] [PULL 3/4] configure: don't warn GTK if disabled Gerd Hoffmann
@ 2018-04-10 9:24 ` Gerd Hoffmann
2018-04-10 14:18 ` [Qemu-devel] [PULL 0/4] Ui 20180410 patches Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2018-04-10 9:24 UTC (permalink / raw)
To: qemu-devel
Cc: Gerd Hoffmann, Peter Xu, Paolo Bonzini, Peter Maydell,
Daniel P . Berrange, Fam Zheng, Philippe Mathieu-Daudé
From: Peter Xu <peterx@redhat.com>
SDL has the same problem as GTK that we might get warnings on SDL ABI
version even if SDL is disabled. Fix that by only probing SDL if SDL is
enabled. Also this should let configure be a little bit faster since we
don't really need to probe SDL stuff when it's off.
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Daniel P. Berrange <berrange@redhat.com>
CC: Fam Zheng <famz@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20180410054034.20479-1-peterx@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 87 ++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 47 insertions(+), 40 deletions(-)
diff --git a/configure b/configure
index 931d2a07cc..0a19b033bc 100755
--- a/configure
+++ b/configure
@@ -2835,49 +2835,52 @@ fi
# Look for sdl configuration program (pkg-config or sdl-config). Try
# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
-if test "$sdlabi" = ""; then
- if $pkg_config --exists "sdl2"; then
- sdlabi=2.0
- elif $pkg_config --exists "sdl"; then
- sdlabi=1.2
- else
- sdlabi=2.0
+sdl_probe ()
+{
+ sdl_too_old=no
+ if test "$sdlabi" = ""; then
+ if $pkg_config --exists "sdl2"; then
+ sdlabi=2.0
+ elif $pkg_config --exists "sdl"; then
+ sdlabi=1.2
+ else
+ sdlabi=2.0
+ fi
+ fi
+
+ if test $sdlabi = "2.0"; then
+ sdl_config=$sdl2_config
+ sdlname=sdl2
+ sdlconfigname=sdl2_config
+ elif test $sdlabi = "1.2"; then
+ sdlname=sdl
+ sdlconfigname=sdl_config
+ else
+ error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0"
+ fi
+
+ if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then
+ sdl_config=$sdlconfigname
+ fi
+
+ if $pkg_config $sdlname --exists; then
+ sdlconfig="$pkg_config $sdlname"
+ sdlversion=$($sdlconfig --modversion 2>/dev/null)
+ elif has ${sdl_config}; then
+ sdlconfig="$sdl_config"
+ sdlversion=$($sdlconfig --version)
+ else
+ if test "$sdl" = "yes" ; then
+ feature_not_found "sdl" "Install SDL2-devel"
fi
-fi
-
-if test $sdlabi = "2.0"; then
- sdl_config=$sdl2_config
- sdlname=sdl2
- sdlconfigname=sdl2_config
-elif test $sdlabi = "1.2"; then
- sdlname=sdl
- sdlconfigname=sdl_config
-else
- error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0"
-fi
-
-if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then
- sdl_config=$sdlconfigname
-fi
-
-if $pkg_config $sdlname --exists; then
- sdlconfig="$pkg_config $sdlname"
- sdlversion=$($sdlconfig --modversion 2>/dev/null)
-elif has ${sdl_config}; then
- sdlconfig="$sdl_config"
- sdlversion=$($sdlconfig --version)
-else
- if test "$sdl" = "yes" ; then
- feature_not_found "sdl" "Install SDL2-devel"
+ sdl=no
+ # no need to do the rest
+ return
+ fi
+ if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
+ echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
fi
- sdl=no
-fi
-if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
- echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
-fi
-sdl_too_old=no
-if test "$sdl" != "no" ; then
cat > $TMPC << EOF
#include <SDL.h>
#undef main /* We don't want SDL to override our main() */
@@ -2919,6 +2922,10 @@ EOF
fi
sdl=no
fi # sdl compile test
+}
+
+if test "$sdl" != "no" ; then
+ sdl_probe
fi
if test "$sdl" = "yes" ; then
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] Ui 20180410 patches
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
` (3 preceding siblings ...)
2018-04-10 9:24 ` [Qemu-devel] [PULL 4/4] configure: don't warn SDL abi " Gerd Hoffmann
@ 2018-04-10 14:18 ` Peter Maydell
4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-04-10 14:18 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 10 April 2018 at 10:24, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 915d34c5f99b0ab91517c69f54272bfdb6ca2b32:
>
> Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-04-09 17:29:10 +0100)
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu tags/ui-20180410-pull-request
>
> for you to fetch changes up to c6093a05d6a84d2144bb6462cf20e907eddf8aeb:
>
> configure: don't warn SDL abi if disabled (2018-04-10 11:22:03 +0200)
>
> ----------------------------------------------------------------
> configure: don't warn on old sdl/gtk versions if disabled.
> keymap + gtk fixes.
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-10 14:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-10 9:24 [Qemu-devel] [PULL 0/4] Ui 20180410 patches Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 1/4] ui: fix keymap detection under Xwayland Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 2/4] gtk: drop pointless code from gd_window_close Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 3/4] configure: don't warn GTK if disabled Gerd Hoffmann
2018-04-10 9:24 ` [Qemu-devel] [PULL 4/4] configure: don't warn SDL abi " Gerd Hoffmann
2018-04-10 14:18 ` [Qemu-devel] [PULL 0/4] Ui 20180410 patches Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).