Darwin patches

- UI fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmJCOc0ACgkQ4+MsLN6t
 wN7OnBAA1ePpS/XQu238h5OBlZpZjgoxomY8paaunSpCyrz0NMest4sJIXmBgA6B
 ryKLQZJQTWzQ/PuAAveML2mkJJsrWUKfH+7c2CyFWV2BmzSvolQ873Dge2mNApTk
 uxKGQosI4WSv79G1GC885UlC8lN1x+HeGLmb1rzxC5q/3S5a2Umtbowg7g6cGoax
 mCyFyftWJ71uEeTFioNjFGFH+fQkMvMMHViA/t0jy6O+y2PZeVxi0RY3lv25471w
 nJTC7nFzD7b5x6hHp9TByjcFqsfADdIiB5TWiiC6loKSii3KdksKYU5v3Qg7raQ1
 VYfHwJeSLatw6p6BPvT5OzWkvldnjmVu6s9SzEaFSTYrIE2o1cOYuxns/eh5UyL5
 HWgukMfrxy9BXPl92JKQRS9AJ16EDT1PNBut6EtqhaU9CGdz/CLFqcWCHJSkF/bu
 qpB3MxLdX3LjmpIK55Sg3HR2UtcGWonf08/jrMKFwxleVM1ztbVhtNFzvJf2gYW0
 kq0uLsIK0N7IsCl+wHaptG8EvysFrfBZBXp8D6fgsMh+su1Bov63Q/NRK1kySv5P
 pUdESweAlUMhuJ9F/8Qaj84UTl+c/QN0WqJ2BJMR9f8LMABwBOuJWi+fWde5eBaq
 DMXeK4gRQIHXDSyr5r+xuer+RS2AzlkYNosu+8SmG1rWaH1YV2g=
 =edDj
 -----END PGP SIGNATURE-----

Merge tag 'darwin-20220329' of https://github.com/philmd/qemu into staging

Darwin patches

- UI fixes

# gpg: Signature made Mon 28 Mar 2022 23:42:21 BST
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'darwin-20220329' of https://github.com/philmd/qemu:
  ui/console: Check console before emitting GL event
  ui/cocoa: Respect left-command-key option
  main-loop: Disable block backend global state assertion on Cocoa
  gitattributes: Cover Objective-C source files

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2022-03-29 15:17:53 +01:00
commit 44064550d9
4 changed files with 37 additions and 1 deletions

1
.gitattributes vendored
View File

@ -1,3 +1,4 @@
*.c.inc diff=c
*.h.inc diff=c
*.m diff=objc
*.py diff=python

View File

@ -270,10 +270,23 @@ bool qemu_mutex_iothread_locked(void);
bool qemu_in_main_thread(void);
/* Mark and check that the function is part of the global state API. */
#ifdef CONFIG_COCOA
/*
* When using the Cocoa UI, addRemovableDevicesMenuItems() is called from
* a thread different from the QEMU main thread and can not take the BQL,
* triggering this assertions in the block layer (commit 0439c5a462).
* As the Cocoa fix is not trivial, disable this assertion for the v7.0.0
* release (when using Cocoa); we will restore it immediately after the
* release.
* This issue is tracked as https://gitlab.com/qemu-project/qemu/-/issues/926
*/
#define GLOBAL_STATE_CODE()
#else
#define GLOBAL_STATE_CODE() \
do { \
assert(qemu_in_main_thread()); \
} while (0)
#endif /* CONFIG_COCOA */
/* Mark and check that the function is part of the I/O API. */
#define IO_CODE() \

View File

@ -923,7 +923,8 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven
/* Don't pass command key changes to guest unless mouse is grabbed */
case kVK_Command:
if (isMouseGrabbed &&
!!(modifiers & NSEventModifierFlagCommand)) {
!!(modifiers & NSEventModifierFlagCommand) &&
left_command_key_enabled) {
if (swap_opt_cmd) {
[self toggleKey:Q_KEY_CODE_ALT];
} else {

View File

@ -1886,6 +1886,9 @@ void dpy_gl_scanout_disable(QemuConsole *con)
con->scanout.kind = SCANOUT_NONE;
}
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_scanout_disable) {
dcl->ops->dpy_gl_scanout_disable(dcl);
}
@ -1909,6 +1912,9 @@ void dpy_gl_scanout_texture(QemuConsole *con,
x, y, width, height
};
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_scanout_texture) {
dcl->ops->dpy_gl_scanout_texture(dcl, backing_id,
backing_y_0_top,
@ -1927,6 +1933,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con,
con->scanout.kind = SCANOUT_DMABUF;
con->scanout.dmabuf = dmabuf;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_scanout_dmabuf) {
dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf);
}
@ -1940,6 +1949,9 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_cursor_dmabuf) {
dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf,
have_hot, hot_x, hot_y);
@ -1954,6 +1966,9 @@ void dpy_gl_cursor_position(QemuConsole *con,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_cursor_position) {
dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y);
}
@ -1967,6 +1982,9 @@ void dpy_gl_release_dmabuf(QemuConsole *con,
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_release_dmabuf) {
dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
}
@ -1983,6 +2001,9 @@ void dpy_gl_update(QemuConsole *con,
graphic_hw_gl_block(con, true);
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? dcl->con : active_console)) {
continue;
}
if (dcl->ops->dpy_gl_update) {
dcl->ops->dpy_gl_update(dcl, x, y, w, h);
}