Drop "send_event" boolean trap in X11Window::restackWindow()

The synthetic ConfigureNotify event is not sent when the stack mode is
TopIf and BottomIf, i.e. the way the restackWindow() function handles
the "send_event" argument is inconsistent.

And the window manager doesn't have to send a synthetic configure event
when processing a _NET_RESTACK_WINDOW client message. It must do it only
after handling a ConfigureRequest request, which
the X11Window::configureRequestEvent() function already does.

So rather than fixing the handling of the "send_event" argument, this
change removes that boolean trap instead.
This commit is contained in:
Vlad Zahorodnii 2024-08-21 16:12:53 +03:00
parent eff06e4109
commit 0622526e8f
4 changed files with 4 additions and 9 deletions

View file

@ -731,7 +731,7 @@ void X11Window::configureRequestEvent(xcb_configure_request_event_t *e)
Xcb::fromXNative(e->y), Xcb::fromXNative(e->width), Xcb::fromXNative(e->height), 0, false);
}
if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) {
restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime(), false);
restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime());
}
// Sending a synthetic configure notify always is fine, even in cases where

View file

@ -186,7 +186,7 @@ void RootInfo::restackWindow(xcb_window_t w, RequestSource src, xcb_window_t abo
if (src != NET::FromApplication && src != FromTool) {
src = NET::FromTool;
}
c->restackWindow(above, detail, src, timestamp, true);
c->restackWindow(above, detail, src, timestamp);
}
}

View file

@ -5435,7 +5435,7 @@ bool X11Window::allowWindowActivation(xcb_timestamp_t time, bool focus_in)
return NET::timestampCompare(time, user_time) >= 0; // time >= user_time
}
void X11Window::restackWindow(xcb_window_t above, int detail, NET::RequestSource src, xcb_timestamp_t timestamp, bool send_event)
void X11Window::restackWindow(xcb_window_t above, int detail, NET::RequestSource src, xcb_timestamp_t timestamp)
{
X11Window *other = workspace()->findClient(Predicate::WindowMatch, above);
if (detail == XCB_STACK_MODE_OPPOSITE) {
@ -5480,10 +5480,6 @@ void X11Window::restackWindow(xcb_window_t above, int detail, NET::RequestSource
workspace()->lowerWindowRequest(this, src, timestamp);
}
}
if (send_event) {
sendSyntheticConfigureNotify();
}
}
bool X11Window::belongsToDesktop() const

View file

@ -229,8 +229,7 @@ public:
void NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction, xcb_button_t button);
void NETMoveResizeWindow(int flags, qreal x, qreal y, qreal width, qreal height);
void GTKShowWindowMenu(qreal x_root, qreal y_root);
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,
bool send_event = false);
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp);
void gotPing(xcb_timestamp_t timestamp);