Age | Commit message (Collapse) | Author |
|
Otherwise it gets leaked never to be recovered.
|
|
|
|
Previously, the clipboard and primary selections shared the same window.
This was racey, and could have led to pasting failures.
On xfixes selection owner change notification, the logic for requesting
the supported mimetypes of the new owner's selection looks like:
xcb_convert_selection(
xwm->xcb_conn,
selection->window,
selection->atom,
xwm->atoms[TARGETS],
xwm->atoms[WL_SELECTION],
selection->timestamp
);
This means ask the selection owner to write its TARGETS for the
`selection->atom` selection (one of PRIMARY, CLIPBOARD, DND_SELECTION)
to `selection->window`'s WL_SELECTION atom.
However, `selection->window` is shared for both PRIMARY and CLIPBOARD
selections, and WL_SELECTION is used as the target atom in both cases.
So, there's a race when both selections change at the same time.
The CLIPBOARD selection might support mimetypes {A, B, C}, and the
PRIMARY only {A, B}. If the ConvertSelection requests/responses "cross
on the wire", so to speak, wlroots can end up believing that the PRIMARY
selection also supports C.
A Wayland client may then ask for the PRIMARY selection in C format,
which will fail with "convert selection failed".
This commit fixes this by using a separate window for PRIMARY and
CLIPBOARD target requests, so that WL_SELECTION can be used as the
target atom in both cases.
|
|
This makes it consistent with xwm_selection_finish.
|
|
Previously it took a wlr_xwm *, which was a bit surprising in that it
freed members of wlr_xwm *, not just its respective selections.
|
|
wlroots would log "Unhandled NET_WM_STATE property change" log
messages for atoms we know about. Simplify the code structure
and remove these extra messages.
|
|
In certain situations windows can have their input field set to false
but still expect to receive input focus by passively listening to key
presses via a parent window. The ICCCM specification outlines how focus
should be given to clients.
Further reading: https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
Relates to #2604
|
|
Developers can use x11trace or similar to analyze the protocol messages.
|
|
The compiler is smarter at figuring out whether a function should be
inlined or not.
|
|
|
|
|
|
|
|
This is necessary to react to changes in position of override-redirect
views.
|
|
Implement a simple loop detection while trying to retrieve the parent
for a TRANSIENT_FOR window.
Fixes swaywm/sway#4624
|
|
|
|
Certain clients require this property to be set for expected behavior.
Most notably, steam client CSD maximize button no longer worked
after unmaximizing once, unless the state was changed by another
method. The state is unset whenever another surface gains focus.
|
|
|
|
This avoids uninitialized items and makes it clear where the magic
number 2 is coming from.
|
|
This helps mitigate buffer overflows.
|
|
In case wl_event_loop_add_timer errors out, don't insert the free'd
wlr_xwayland_surface in the list.
Closes: https://github.com/swaywm/wlroots/issues/1721
|
|
|
|
This improves the failure cases when incremental transfers fail to
complete successfully for one reason or another.
|
|
If Xwayland is restarted, the ready handler assumes there is no xwm instance.
This means all of xwm was leaked on Xwayland restart. This caused compositors
to consume all cpu resources, where time is spent dispatching. Now we destroy
xwm if we get an event mask containing WL_EVENT_HANGUP or WL_EVENT_ERROR.
|
|
This fixes issues with (at least) dialogs in Jetbrains IDEs becoming
unclickable if they ever lost focus (ref. swaywm/sway#5373). Prior to
this change, since `xwm->focus_surface` would be set prior to
`xwm_surface_activate` being called, the latter would short-circuit
immediately and not notify the application of the focus change.
|
|
Split the server part of wlr_xwayland into wlr_xwayland_server. This
allows compositors to implement their own XWM when wlroots' isn't a good
fit.
|
|
Previously, some atoms had a leading underscore, others didn't. Be more
consistent and never use a leading underscore (symbols with a leading
underscore followed by an upper-case letter are reserved).
|
|
|
|
It's very easy to break the mapping between the atom_name enum and the
atom_map array. Use explicit indexes to prevent issues.
|
|
This reflects what i3 does [1].
[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076
Fixes: c067fbc010da ("xwm: allow applications to change focus between their own surfaces")
Closes: https://github.com/swaywm/sway/issues/4926
|
|
Although currently this problem is present in only Steam, and it is
actually a client bug.
|
|
Without this information, compositors have no way to tell whether
or not to consider the position information valid. Most notably,
a compositor needs to know if it should pick a position for the
surface or use the position sent in the configure request.
|
|
|
|
|
|
This is what ICCCM states that a WM should do.
|
|
This commit makes sure surface->mapped is true when the unmapped event is
emitted. This is necessary because listeners can only damage surfaces that are
mapped. This is similar to the fact that the destroy event is emitted before
any destruction is actually made.
Fixes https://github.com/swaywm/sway/issues/3568
|
|
Fixes: https://github.com/swaywm/wlroots/issues/1469
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Since xwm only manipulates the stack when focusing a window, newly
mapped windows should be stacked below the focused window. This prevents
the newly mapped window from stealing focus due to being on the top of
the stack.
|
|
This prevents some annoying issues when e.g. not including wlr/config.h or
making a typo in the guard name.
|
|
We spent literally hours trying to debug this. Turns out it's a typo.
Kill me.
|
|
|
|
|
|
|
|
An X11 client can leave the hints->input WM hint unspecified,
by not setting the XCB_ICCCM_WM_HINT_INPUT flag in hints->flags.
In that case, we should assume a sane default.
Make the hint default to true, so that clients which do not specify
the hint, like mupdf, still get keyboard focus.
This should fix swaywm/sway#2231
|
|
It's not used (XCB_IMAGE_FORMAT_Z_PIXMAP comes from xproto.h) and we
don't even have a pkg-config dependency on xcb-image, making the build
to fail on that inclusion on systems without the package.
|
|
|
|
|
|
|
|
Adds a modal property to indicate whether the surface wants to be a
modal.
|
|
153f37bdf57c61e7fb09162a6791afe8b9b4d0ef (#1145) removed the
wlr_xwayland_is_unamanged function while fixing OR, because it was
belieived that it's supposed to work around the broken OR handling.
This was a misunderstanding. is_unmanaged is (while sort of a hack)
intended to work around inherent differences between "real" X sessions
and our Xwayland/wayland situation.
The main reason it exists is to support applications like rofi and dzen,
while not handing focus to other OR windows (which should *not* be
required).
Traditionally, these applications just grabbed input from X and didn't
need to be focused by any logic in the WM. Which of course doesn't work
in wayland compositors. So we have to give them focus in some way.
Giving *every* OR window focus, breaks other applications that don't
expect focus to change.
A testcase that was pointed out to me where wlr_xwayland_is_unamanged was
breaking things is https://github.com/swaywm/sway/issues/2128 (syncplay,
gitk, gitgui)
Supposedly it broke using keyboard to navigate the menus.
I can't reproduce this with this patch. The popups can be navigated as
long as the parent has focus.
|
|
surface: add wlr_surface_role.precommit
|