summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-10-21 16:22:06 +0200
committerHans de Goede <hdegoede@redhat.com>2010-10-25 11:36:34 +0200
commit18e6edb93adf45adeccf994f5561b7dc92012cf8 (patch)
tree1dcdcf02179b074e48107a1e3402559ddf490962
parenta0f32b620b333ae538500d21bc85650b3498a705 (diff)
downloadspice-18e6edb93adf45adeccf994f5561b7dc92012cf8.tar.gz
spice-18e6edb93adf45adeccf994f5561b7dc92012cf8.tar.xz
spice-18e6edb93adf45adeccf994f5561b7dc92012cf8.zip
spicec-x11: Do not set _NET_WM_USER_TIME to 0 on startup
Setting _NET_WM_USER_TIME to 0 means we do not want focus, not good.
-rw-r--r--client/x11/red_window.cpp10
-rw-r--r--client/x11/red_window_p.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 416f6c74..c3ee1b02 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -801,7 +801,7 @@ void RedWindow_p::win_proc(XEvent& event)
}
case KeyPress:
red_window->handle_key_press_event(*red_window, &event.xkey);
- red_window->last_event_time = event.xkey.time;
+ red_window->_last_event_time = event.xkey.time;
XChangeProperty(x_display, red_window->_win, wm_user_time,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)&event.xkey.time, 1);
@@ -833,7 +833,7 @@ void RedWindow_p::win_proc(XEvent& event)
break;
}
red_window->get_listener().on_mouse_button_press(button, state);
- red_window->last_event_time = event.xkey.time;
+ red_window->_last_event_time = event.xkey.time;
XChangeProperty(x_display, red_window->_win, wm_user_time,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)&event.xbutton.time, 1);
@@ -1119,6 +1119,7 @@ RedWindow_p::RedWindow_p()
, _ignore_pointer (false)
,_width (200)
,_height (200)
+ ,_last_event_time (0)
{
}
@@ -1534,8 +1535,9 @@ void RedWindow::show(int screen_id)
XDeleteProperty(x_display, _win, wm_state);
wait_parent = true;
}
- XChangeProperty(x_display, _win, wm_user_time, XA_CARDINAL, 32,
- PropModeReplace, (unsigned char *)&last_event_time, 1);
+ if (_last_event_time != 0)
+ XChangeProperty(x_display, _win, wm_user_time, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&_last_event_time, 1);
XMapWindow(x_display, _win);
move_to_current_desktop();
_expect_parent = wait_parent;
diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h
index 4ad5451a..777a8551 100644
--- a/client/x11/red_window_p.h
+++ b/client/x11/red_window_p.h
@@ -82,7 +82,7 @@ protected:
RedWindow *_red_window;
int _width;
int _height;
- Time last_event_time;
+ Time _last_event_time;
};
#endif