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
This commit is contained in:
Thomas Lübking 2016-01-15 12:18:24 +01:00
parent 87795eef2a
commit e73e331f35
2 changed files with 5 additions and 5 deletions

View file

@ -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; xcb_client_message_event_t ev;
memset(&ev, 0, sizeof(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.type = a;
ev.format = 32; ev.format = 32;
ev.data.data32[0] = protocol; ev.data.data32[0] = protocol;
ev.data.data32[1] = xTime(); ev.data.data32[1] = timestamp;
ev.data.data32[2] = data1; ev.data.data32[2] = data1;
ev.data.data32[3] = data2; ev.data.data32[3] = data2;
ev.data.data32[4] = data3; ev.data.data32[4] = data3;
@ -1363,8 +1363,7 @@ void Client::takeFocus()
else else
demandAttention(false); // window cannot take input, at least withdraw urgency demandAttention(false); // window cannot take input, at least withdraw urgency
if (info->supportsProtocol(NET::TakeFocusProtocol)) { if (info->supportsProtocol(NET::TakeFocusProtocol)) {
updateXTime(); sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus, 0, 0, 0, XCB_CURRENT_TIME);
sendClientMessage(window(), atoms->wm_protocols, atoms->wm_take_focus);
} }
workspace()->setShouldGetFocus(this); workspace()->setShouldGetFocus(this);

View file

@ -486,7 +486,8 @@ private:
void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void killProcess(bool ask, xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME);
void updateUrgency(); void updateUrgency();
static void sendClientMessage(xcb_window_t w, xcb_atom_t a, xcb_atom_t protocol, 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 embedClient(xcb_window_t w, xcb_visualid_t visualid, xcb_colormap_t colormap, uint8_t depth);
void detectNoBorder(); void detectNoBorder();