mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xwayland: fix issue with panel getting stuck offscreen
For unknown reasons, XWayland surfaces that are completely offscreen seem not to generate commit events. In rare cases, this can prevent an offscreen window from moving onscreen (since we wait for a commit event that never occurs). As a workaround, move offscreen surfaces immediately. This fixes an issue that I can reproduce by having qmpanel displayed on a (larger) external monitor, then undocking the laptop so that qmpanel requests a simultaneous move+resize to the (smaller) laptop display.
This commit is contained in:
parent
3101b0c5b1
commit
a3f880716f
1 changed files with 13 additions and 2 deletions
|
|
@ -311,9 +311,20 @@ xwayland_view_configure(struct view *view, struct wlr_box geo)
|
|||
wlr_xwayland_surface_configure(xwayland_surface_from_view(view),
|
||||
geo.x, geo.y, geo.width, geo.height);
|
||||
|
||||
/*
|
||||
* For unknown reasons, XWayland surfaces that are completely
|
||||
* offscreen seem not to generate commit events. In rare cases,
|
||||
* this can prevent an offscreen window from moving onscreen
|
||||
* (since we wait for a commit event that never occurs). As a
|
||||
* workaround, move offscreen surfaces immediately.
|
||||
*/
|
||||
bool is_offscreen = !wlr_box_empty(&view->current) &&
|
||||
!wlr_output_layout_intersects(view->server->output_layout, NULL,
|
||||
&view->current);
|
||||
|
||||
/* If not resizing, process the move immediately */
|
||||
if (view->current.width == geo.width
|
||||
&& view->current.height == geo.height) {
|
||||
if (is_offscreen || (view->current.width == geo.width
|
||||
&& view->current.height == geo.height)) {
|
||||
view->current.x = geo.x;
|
||||
view->current.y = geo.y;
|
||||
view_moved(view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue