summaryrefslogtreecommitdiffstats
path: root/client/x11/platform.cpp
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-10-03 22:08:45 +0200
committerHans de Goede <hdegoede@redhat.com>2010-10-04 11:49:14 +0200
commit57bfa782d8406d84e4b52d8d457a9c6f86316960 (patch)
tree08b8c694b1f4776606fdb61feecf8ff96e427af9 /client/x11/platform.cpp
parentaabca2864d9439bc061feedd8d315b9aaac5c666 (diff)
downloadspice-57bfa782d8406d84e4b52d8d457a9c6f86316960.tar.gz
spice-57bfa782d8406d84e4b52d8d457a9c6f86316960.tar.xz
spice-57bfa782d8406d84e4b52d8d457a9c6f86316960.zip
spicec-x11: Add XFlush calls were needed
Since we do not always "pump" libX11's event loop by calling XPending (we only call XPending when there is data to read from the display fd), we must always explictly flush any outstanding requests. This patch adds a whole bunch of missing XFlush calls.
Diffstat (limited to 'client/x11/platform.cpp')
-rw-r--r--client/x11/platform.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 75b34c61..82660a44 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -506,6 +506,7 @@ void Platform::error_beep()
}
XBell(x_display, 0);
+ XFlush(x_display);
}
void Platform::msleep(unsigned int millisec)
@@ -2028,6 +2029,7 @@ void XMonitor::disable()
for (; iter != _clones.end(); iter++) {
(*iter)->disable();
}
+ XFlush(x_display);
X_DEBUG_SYNC(display);
}
@@ -2049,6 +2051,7 @@ void XMonitor::enable()
for (; iter != _clones.end(); iter++) {
(*iter)->enable();
}
+ XFlush(x_display);
X_DEBUG_SYNC(display);
}
@@ -2975,11 +2978,13 @@ static void set_keyboard_led(XLed led, int set)
case X11_CAPS_LOCK_LED:
if (caps_lock_mask) {
XkbLockModifiers(x_display, XkbUseCoreKbd, caps_lock_mask, set ? caps_lock_mask : 0);
+ XFlush(x_display);
}
return;
case X11_NUM_LOCK_LED:
if (num_lock_mask) {
XkbLockModifiers(x_display, XkbUseCoreKbd, num_lock_mask, set ? num_lock_mask : 0);
+ XFlush(x_display);
}
return;
case X11_SCROLL_LOCK_LED:
@@ -2987,6 +2992,7 @@ static void set_keyboard_led(XLed led, int set)
keyboard_control.led_mode = set ? LedModeOn : LedModeOff;
keyboard_control.led = led;
XChangeKeyboardControl(x_display, KBLed | KBLedMode, &keyboard_control);
+ XFlush(x_display);
return;
}
}
@@ -3034,6 +3040,7 @@ void Platform::reset_cursor_pos()
SpicePoint size = primary_monitor->get_size();
Window root_window = RootWindow(x_display, DefaultScreen(x_display));
XWarpPointer(x_display, None, root_window, 0, 0, 0, 0, pos.x + size.x / 2, pos.y + size.y / 2);
+ XFlush(x_display);
}
WaveRecordAbstract* Platform::create_recorder(RecordClient& client,
@@ -3080,6 +3087,7 @@ void XBaseLocalCursor::set(Window window)
{
if (_handle) {
XDefineCursor(x_display, window, _handle);
+ XFlush(x_display);
}
}
@@ -3258,6 +3266,7 @@ bool Platform::on_clipboard_grab(uint32_t *types, uint32_t type_count)
return false;
}
XSetSelectionOwner(x_display, clipboard_prop, platform_win, CurrentTime);
+ XFlush(x_display);
return true;
}
@@ -3337,6 +3346,7 @@ bool Platform::on_clipboard_request(uint32_t type)
}
clipboard_request_target = format;
XConvertSelection(x_display, clipboard_prop, format, clipboard_prop, platform_win, CurrentTime);
+ XFlush(x_display);
return true;
}