Commit e73e331f authored by Thomas Lübking's avatar Thomas Lübking
Browse files

use XCB_CURRENT_TIME for NET::TakeFocusProtocol

The only clients that really seem to rely on it are
Java and they're apparently "broken", resp. extremely
picky on the tiemstamp and probably happily refuse focus
if it's *not* equal to the current server time (ie. anything else
happens at this moment) and overmore feel oblieged to act as WM
by juggling around VDs at all.

BUG: 347153
FIXED-IN: 5.6
REVIEW: 126753
parent 87795eef
......@@ -1047,7 +1047,7 @@ void Client::updateHiddenPreview()
}
}
void Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, uint32_t data1, uint32_t data2, uint32_t data3)
void Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, uint32_t data1, uint32_t data2, uint32_t data3, xcb_timestamp_t timestamp)
{
xcb_client_message_event_t ev;
memset(&ev, 0, sizeof(ev));
......@@ -1056,7 +1056,7 @@ void Client::sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol
ev.type = a;
ev.format = 32;
ev.data.data32[0] = protocol;
ev.data.data32[1] = xTime();
ev.data.data32[1] = timestamp;
ev.data.data32[2] = data1;
ev.data.data32[3] = data2;
ev.data.data32[4] = data3;
......@@ -1363,8 +1363,7 @@ void Client::takeFocus()
else
demandAttention(false); // window cannot take input, at least withdraw urgency
if (info->supportsProtocol(NET::TakeFocusProtocol)) {
updateXTime();
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus, 0, 0, 0, XCB_CURRENT_TIME);
}
workspace()->setShouldGetFocus(this);
......
......@@ -486,7 +486,8 @@ private:
void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
void updateUrgency();
static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol,
uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0);
uint32_t data1 = 0, uint32_t data2 = 0, uint32_t data3 = 0,
xcb_timestamp_t timestamp = xTime());
void embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth);
void detectNoBorder();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment