Bugfix: use the global root variable, don’t get the first one (Thanks quaec)
The case of an X11 server having multiple displays is handled correctly by the code in src/mainx.c. However, due to some functions not being correctly refactored and still getting the first screen (and also the first root window) from the XCB connection, i3 was operating on the wrong root window.
This commit is contained in:
parent
f6638b4b9e
commit
f2896d34e0
|
@ -379,7 +379,6 @@ void floating_resize_window(xcb_connection_t *conn, Client *client,
|
||||||
*/
|
*/
|
||||||
void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event,
|
void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event,
|
||||||
xcb_window_t confine_to, border_t border, callback_t callback, void *extra) {
|
xcb_window_t confine_to, border_t border, callback_t callback, void *extra) {
|
||||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
|
||||||
uint32_t new_x, new_y;
|
uint32_t new_x, new_y;
|
||||||
Rect old_rect;
|
Rect old_rect;
|
||||||
if (client != NULL)
|
if (client != NULL)
|
||||||
|
|
|
@ -458,8 +458,6 @@ int handle_screen_change(void *prophs, xcb_connection_t *conn,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
|
int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
|
||||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
|
||||||
|
|
||||||
add_ignore_event(event->sequence);
|
add_ignore_event(event->sequence);
|
||||||
|
|
||||||
Client *client = table_get(&by_child, event->window);
|
Client *client = table_get(&by_child, event->window);
|
||||||
|
|
|
@ -109,7 +109,6 @@ static int sig_handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_p
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static xcb_window_t open_input_window(xcb_connection_t *conn, Rect screen_rect, uint32_t width, uint32_t height) {
|
static xcb_window_t open_input_window(xcb_connection_t *conn, Rect screen_rect, uint32_t width, uint32_t height) {
|
||||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
|
||||||
xcb_window_t win = xcb_generate_id(conn);
|
xcb_window_t win = xcb_generate_id(conn);
|
||||||
|
|
||||||
uint32_t mask = 0;
|
uint32_t mask = 0;
|
||||||
|
|
|
@ -112,7 +112,6 @@ bool workspace_is_visible(Workspace *ws) {
|
||||||
*/
|
*/
|
||||||
void workspace_show(xcb_connection_t *conn, int workspace) {
|
void workspace_show(xcb_connection_t *conn, int workspace) {
|
||||||
bool need_warp = false;
|
bool need_warp = false;
|
||||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
|
||||||
/* t_ws (to workspace) is just a convenience pointer to the workspace we’re switching to */
|
/* t_ws (to workspace) is just a convenience pointer to the workspace we’re switching to */
|
||||||
Workspace *t_ws = workspace_get(workspace-1);
|
Workspace *t_ws = workspace_get(workspace-1);
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,6 @@ uint32_t get_colorpixel(xcb_connection_t *conn, char *hex) {
|
||||||
*/
|
*/
|
||||||
xcb_window_t create_window(xcb_connection_t *conn, Rect dims, uint16_t window_class, int cursor,
|
xcb_window_t create_window(xcb_connection_t *conn, Rect dims, uint16_t window_class, int cursor,
|
||||||
bool map, uint32_t mask, uint32_t *values) {
|
bool map, uint32_t mask, uint32_t *values) {
|
||||||
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
|
|
||||||
xcb_window_t result = xcb_generate_id(conn);
|
xcb_window_t result = xcb_generate_id(conn);
|
||||||
xcb_cursor_t cursor_id = xcb_generate_id(conn);
|
xcb_cursor_t cursor_id = xcb_generate_id(conn);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue