Changeset View
Changeset View
Standalone View
Standalone View
xembed-sni-proxy/sniproxy.cpp
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | 134 | #endif | |||
---|---|---|---|---|---|
204 | //we can either send an X event to the client or XTest | 204 | //we can either send an X event to the client or XTest | ||
205 | //some don't support direct X events (GTK3/4), and some don't support XTest because reasons | 205 | //some don't support direct X events (GTK3/4), and some don't support XTest because reasons | ||
206 | //note also some clients might not have the XTest extension. We may as well assume it does and just fail to send later. | 206 | //note also some clients might not have the XTest extension. We may as well assume it does and just fail to send later. | ||
207 | 207 | | |||
208 | //we query if the client selected button presses in the event mask | 208 | //we query if the client selected button presses in the event mask | ||
209 | //if the client does supports that we send directly, otherwise we'll use xtest | 209 | //if the client does supports that we send directly, otherwise we'll use xtest | ||
210 | auto waCookie = xcb_get_window_attributes(c, wid); | 210 | auto waCookie = xcb_get_window_attributes(c, wid); | ||
211 | auto windowAttributes = xcb_get_window_attributes_reply(c, waCookie, nullptr); | 211 | auto windowAttributes = xcb_get_window_attributes_reply(c, waCookie, nullptr); | ||
212 | if (! windowAttributes->all_event_masks & XCB_EVENT_MASK_BUTTON_PRESS) { | 212 | if (! (windowAttributes->all_event_masks & XCB_EVENT_MASK_BUTTON_PRESS)) { | ||
213 | m_injectMode = XTest; | 213 | m_injectMode = XTest; | ||
214 | } | 214 | } | ||
215 | 215 | | |||
216 | //there's no damage event for the first paint, and sometimes it's not drawn immediately | 216 | //there's no damage event for the first paint, and sometimes it's not drawn immediately | ||
217 | //not ideal, but it works better than nothing | 217 | //not ideal, but it works better than nothing | ||
218 | //test with xchat before changing | 218 | //test with xchat before changing | ||
219 | QTimer::singleShot(500, this, &SNIProxy::update); | 219 | QTimer::singleShot(500, this, &SNIProxy::update); | ||
220 | } | 220 | } | ||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |