C/C++ API to set screen for a window on Wayland

Viet Dang dangvd at gmail.com
Thu Aug 8 22:17:46 BST 2024


Ah I got it, it didn't work because I used QWidget::setScreen(), but the
layer shell screen configuration is ScreenFromQWindow. When I changed to
using QWindow::setScreen() then it worked.

Thanks again, Aleix.

Viet


On Thu, Aug 8, 2024 at 1:20 AM Viet Dang <dangvd at gmail.com> wrote:

> Hi Aleix,
>
> Maybe my post wasn't clear, this is for multi-screen/multi-monitor setup,
> so for example I need to set the dock to screen 1 or screen 2 etc.
>
> I've already used layer-shell to set the dock's anchor, strut, and
> layer, but it doesn't seem to support setting screen/monitor?
>
> Thanks,
> Viet
>
>
> On Thu, Aug 8, 2024 at 12:56 AM Aleix Pol <aleixpol at kde.org> wrote:
>
>> It depends on how you're placing your surface.
>>
>> Given you're asking about a dock in the KWin list, you should be using
>> layer-shell. It does allow setting the output when placing it:
>>
>> https://wayland.app/protocols/wlr-layer-shell-unstable-v1#zwlr_layer_shell_v1:request:get_layer_surface
>>
>> As C++ API you can use layer-shell-qt:
>> https://invent.kde.org/plasma/layer-shell-qt/
>>
>> Best of luck,
>> Aleix
>>
>> On Thu, Aug 8, 2024 at 12:54 AM Viet Dang <dangvd at gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > On Wayland, is there any way for third-party docks to set the screen
>> where the dock resides?
>> >
>> > I've looked through the Wayland protocol list but did not find anything
>> relevant.
>> >
>> > Thanks a lot,
>> > Viet
>> >
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20240808/0af38f3e/attachment.htm>


More information about the kwin mailing list