Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

foreign-toplevel-management: Report the surface's parent #52

Merged
merged 1 commit into from
Oct 18, 2020

Conversation

dos1
Copy link
Contributor

@dos1 dos1 commented Jul 28, 2019

Some window switchers, like mobile ones, may want to skip or group dialogs and other child windows on their window lists. Right now the only way to group toplevels is to use app_id, which will end up grouping too much in case of multiple toplevels with separate documents. Reporting on the toplevel's parent makes it easy to distinguish separate window stacks and act accordingly.

@ddevault ddevault requested a review from emersion July 28, 2019 12:48
@ddevault
Copy link
Contributor

ddevault commented Jul 28, 2019

Note that this will only work if the client has bound an object to the parent toplevel.

@emersion
Copy link
Member

Note that this will only work if the client has bound an object to the parent toplevel.

Since toplevels are not globals, but are server-created objects via the toplevel event on the manager, it should be fine.

However the docs should specify what happens if the client has destroyed the toplevel that is the parent. No event? Event with null?

I'd also like to see a working implementation, just to make sure there are no issues we missed.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@AdrianVovk
Copy link

Ping? This would be really great to have in the proto

@ddevault
Copy link
Contributor

Send patch?

dkondor added a commit to dkondor/wlroots that referenced this pull request Oct 5, 2020
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Oct 5, 2020
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Oct 5, 2020
@dkondor
Copy link
Contributor

dkondor commented Oct 5, 2020

Hi,

I'm interested in having this functionality and started working on an implementation.
I have a working example with wlroots + wayfire + cairo-dock, as a combination of these three branches:
https://github.com/dkondor/wlroots/tree/foreign-toplevel-report-parent
https://github.com/dkondor/wayfire/tree/foreign-toplevel-report-parent
https://github.com/dkondor/cairo-dock-core/tree/wayland_egl

So far, what I've tested is the simple rule that child views should not be displayed in the taskbar as separate icons. I have not tested more complicated functionality (grouping / mapping views together). I'm happy to create other examples beside cairo-dock which is a complex case, if needed. Should I create separate PRs for wlroots and wayfire?

Thanks!

@ammen99
Copy link
Member

ammen99 commented Oct 5, 2020

Hi,

I'm interested in having this functionality and started working on an implementation.
I have a working example with wlroots + wayfire + cairo-dock, as a combination of these three branches:
https://github.com/dkondor/wlroots/tree/foreign-toplevel-report-parent
https://github.com/dkondor/wayfire/tree/foreign-toplevel-report-parent
https://github.com/dkondor/cairo-dock-core/tree/wayland_egl

So far, what I've tested is the simple rule that child views should not be displayed in the taskbar as separate icons. I have not tested more complicated functionality (grouping / mapping views together). I'm happy to create other examples beside cairo-dock which is a complex case, if needed. Should I create separate PRs for wlroots and wayfire?

Thanks!

Yes, the protocol is waiting for implementation :)

@ammen99
Copy link
Member

ammen99 commented Oct 7, 2020

However the docs should specify what happens if the client has destroyed the toplevel that is the parent. No event? Event with null?

IMO no event makes more sense than event with null. After all, null events means no parent. Otherwise LGTM.

@emersion
Copy link
Member

OK, no event makes sense to me. After all, if the client has destroyed the toplevel, it's on them.

Can you add it to the protocol description?

Some window switchers, like mobile ones, may want to skip or group
dialogs and other child windows on their window lists. Right now
the only way to group toplevels is to use app_id, which will end
up grouping too much in case of multiple toplevels with separate
documents. Reporting on the toplevel's parent makes it easy to
distinguish separate window stacks and act accordingly.
@dos1
Copy link
Contributor Author

dos1 commented Oct 17, 2020

Is this wording okay?

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, protocol changes LGTM. Waiting on the wlroots pull request to be reviewed before merging this.

dkondor added a commit to dkondor/wlroots that referenced this pull request Oct 18, 2020
@emersion emersion merged commit 992841c into swaywm:master Oct 18, 2020
@emersion
Copy link
Member

Thanks!

emersion pushed a commit to swaywm/wlroots that referenced this pull request Oct 18, 2020
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Nov 6, 2020
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Nov 6, 2020
see swaywm/wlr-protocols#52

Windows that have a parent are ignored (not shown in the taskbar, since these are usually dialogs).
Also re-wrote the logic for identifying and deciding when an icon should be
shown for a foreign-toplevel. Signals are now always emitted by the done event
handler.

Additionally, improvements to parse app ID under Wayland as well

Moved the functionality for this from cairo-dock-X-utilities.c to
cairo-dock-windows-manager.c (as a new function: gldi_window_parse_class()),
this is now used by both the X and Wayland backends. This fixes issues by
not recognizing some apps (e.g. Firefox and gnome-terminal if using XWayland)
due to the app ID not matching the expected case.
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Nov 6, 2020
see swaywm/wlr-protocols#52

Windows that have a parent are ignored (not shown in the taskbar, since these are usually dialogs).
Also re-wrote the logic for identifying and deciding when an icon should be
shown for a foreign-toplevel. Signals are now always emitted by the done event
handler.

Additionally, improvements to parse app ID under Wayland as well

Moved the functionality for this from cairo-dock-X-utilities.c to
cairo-dock-windows-manager.c (as a new function: gldi_window_parse_class()),
this is now used by both the X and Wayland backends. This fixes issues by
not recognizing some apps (e.g. Firefox and gnome-terminal if using XWayland)
due to the app ID not matching the expected case.
dkondor added a commit to dkondor/cairo-dock-core that referenced this pull request Nov 6, 2020
see swaywm/wlr-protocols#52

Windows that have a parent are ignored (not shown in the taskbar, since these are usually dialogs).
Also re-wrote the logic for identifying and deciding when an icon should be
shown for a foreign-toplevel. Signals are now always emitted by the done event
handler.

Additionally, improvements to parse app ID under Wayland as well

Moved the functionality for this from cairo-dock-X-utilities.c to
cairo-dock-windows-manager.c (as a new function: gldi_window_parse_class()),
this is now used by both the X and Wayland backends. This fixes issues by
not recognizing some apps (e.g. Firefox and gnome-terminal if using XWayland)
due to the app ID not matching the expected case.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

6 participants