Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder/window open/close animations #160

Open
probonopd opened this issue Dec 3, 2022 · 5 comments
Open

Folder/window open/close animations #160

probonopd opened this issue Dec 3, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed qt Qt expertise needed

Comments

@probonopd
Copy link
Member

animation.mp4

We want this kind of animation whenever a folder is double-clicked in Filer, to visuallly conect the closed folder icon with the window that gets opened when the icon is double-clicked. Same for closing.

https://twitter.com/reionwong/status/1359573324704137219

ICCCM/EWMH has WM_ICON_GEOMETRY:

This optional property MAY be set by stand alone tools like a taskbar or an iconbox. It specifies the geometry of a possible icon in case the window is iconified.

Rationale: This makes it possible for a Window Manager to display a nice animation like morphing the window into its icon.

Geometry of iconified view so window manager can animate iconify: WM_ICON_GEOMETRY

Code:

https://github.com/freedesktop-unofficial-mirror/xcb__util-wm/blob/24eb17df2e1245885e72c9d4bbb0a0f69f0700f2/ewmh/ewmh.c.m4#L1067-L1099

Do we have to set WM_ICON_GEOMETRY (e.g., using NETWinInfo::setIconGeometry) whenever we create a Filer window, to the coordinates of the icon that was double-clicked to open the window? When the window is about to be closed, we would need to figure out the coordinates of the icon again, since the window which contains the icon may have been moved or closed in between.

According to lxqt/lxqt#587 (comment)

The icon geometry stuff is for WMs which support animations when minimizing windows.
When you minimize a window, many WMs use that rectangle as the destination of their animations.
For example, openbox is one of these WMs.

Would KWin use WM_ICON_GEOMETRY when opening and closing windows? Or only when minimizing/unminimizing windows? We need it for opening and closing. Could we write a KWin plugin for that?

Would Filer need to set the icon geometry whenever we receive KWindowSystem::windowChanged on one of the Filer windows? We would need to check whether there is a Filer window that contains the icon for that window, and set the window's WM_ICON_GEOMETRY to that.

NETWinInfo info(QX11Info::connection(),...;
info.setIconGeometry(...);

https://github.com/lxqt/lxqt-panel/pull/166/files

But: How would we set the WM_ICON_GEOMETRY for windows that are about to be launched and are not yet on screen, e.g., when launching?

Idea:

The following does not work quite yet, how to construct a NETWinInfo?

        KWindowInfo info(id, NET::WMPid);
        const QList<WId> winIds = KWindowSystem::windows();
        for (WId cand_id : winIds){
            KWindowInfo cand_info(cand_id, NET::WMPid);
            if(cand_info.pid() == info.pid())
                NETWinInfo nwi = NETWinInfo(QX11Info::display(), cand_id, QX11Info::appRootWindow(), NET::WMState, NET::Role::Client);
                nwi.setIconGeometry(NETRect(QRect(0,0,10,10)));
                KWindowSystem::minimizeWindow(cand_id);
        }
@probonopd probonopd added enhancement New feature or request help wanted Extra attention is needed qt Qt expertise needed labels Dec 3, 2022
@louies0623

This comment was marked as off-topic.

@louies0623
Copy link

Is it like this animation ?(picture selection is bad)
experimental_low2

@probonopd
Copy link
Member Author

Yes, that is what we need. but slower and less flickery ;-)

@louies0623
Copy link

louies0623 commented Dec 30, 2022

2022-12-30.15-55-20.mp4

@probonopd
Copy link
Member Author

Yes, something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed qt Qt expertise needed
Projects
None yet
Development

No branches or pull requests

2 participants