fluid icon indicating copy to clipboard operation
fluid copied to clipboard

Headerbars (integrated app bar and window decorations)

Open iBelieve opened this issue 7 years ago • 19 comments

https://material.google.com/layout/structure.html#structure-system-bars

iBelieve avatar Aug 17 '16 14:08 iBelieve

Hi, if integrated app bar and window decorations, should we remove windows manager(like openbox,etc) in Qt quick window component, and extend a sub qml window, implement our own "move-window, change-window-size) functions? @iBeliever @plfiorini

SunRain avatar Sep 02 '16 08:09 SunRain

just like what @iBeliever did in qml-material

SunRain avatar Sep 02 '16 08:09 SunRain

I mean WindowFlags like Qt::CustomizeWindowHint, Qt::FramelessWindowHint, etc(Can't remeber clearly)

SunRain avatar Sep 02 '16 08:09 SunRain

@SunRain On the qmlOS desktop we can handle that from the platform theme plugin with a Wayland protocol that would tell the compositor weather it should decorate the window or whether the window does it by itself. On other desktops we should expect that the window manager will decorate the window hence the headerbar somehow should turn into a normal toolbar.

plfiorini avatar Sep 02 '16 09:09 plfiorini

Sorry, don't know about wayland related things, you mean this would handled by greenisland(or where is the platform theme plugin) ? @plfiorini

SunRain avatar Sep 03 '16 13:09 SunRain

The workspace/platformtheme part in https://github.com/qmlos/workspace ?

SunRain avatar Sep 03 '16 13:09 SunRain

@SunRain the platform theme plugin in the workspace repository (https://github.com/qmlos/workspace) could set an env variable to disable Qt client side dialogs when it detects the application wants to decorate itself using the headerbar. The headerbar also need to communicate back to the application to move the window when dragging the bar.

plfiorini avatar Sep 03 '16 13:09 plfiorini

@SunRain we then need to set a window property on windows that use the header bar so that the compositor knows which windows decorate themselves and which one needs a server-side decoration

plfiorini avatar Sep 03 '16 13:09 plfiorini

Hi, is it possbile to only customize the Control.ToolBar to implement this, like this sample http://paste.ubuntu.com/23128509/ I only set window flag to Qt.FramelessWindowHint, and handle mouse event in it. The problem is I need to add app icon to system(OS) task manger bar when app hide, and show app when clicking OS task manger bar. I think these problems chould be solved by implementing from some dbus event(or some common OS libraries)?

SunRain avatar Sep 03 '16 15:09 SunRain

I found deepin(DE)'s filemanager used the Qt.FramelessWindowHint flag and implement their own hide/show functions via X11( see https://github.com/linuxdeepin/dde-file-manager/blob/master/widgets/dwindowframe.cpp#L512 ), maybe we can add some wayland handle like this.

SunRain avatar Sep 03 '16 15:09 SunRain

@SunRain Yeah Qt.FramelessWindowHint should work on all desktops, and X11 as well.

We don't need to use platform specific code for minimize, maximize and close, we can do it with the Qt API.

However what we need is Qt hooks to trigger window move and resize from the client side QML decoration.

QPlatformWindow has a startSystemResize() method to trigger platform specific code for resize, and once this patch is integration it will have a startSystemMove() as well: https://codereview.qt-project.org/#/c/150399/

EDIT: What I was talking about earlier is more Liri OS implementation details, we need a way to know when a Qt client app wants to decorate itself or not. If the Qt client don't decorate itself will need to draw server decorations, but it falls in a separate issue elsewhere.

plfiorini avatar Feb 08 '17 07:02 plfiorini

Moving windows from the decoration will be possible with Qt 5.11 (on X11 and Wayland at least).

https://imgur.com/avidazd

plfiorini avatar Feb 09 '18 14:02 plfiorini

Do you have some working example code? I would like to test working qml csd.

damianatorrpm avatar Feb 13 '18 07:02 damianatorrpm

Not yet because I don't have a Qt 5.11 build right now.

plfiorini avatar Feb 19 '18 16:02 plfiorini

is this yet ready for testing? looks great!

milohr avatar Mar 18 '18 16:03 milohr

I would really love to see CSD as part of Liri's apps. I guess having it as part of fluid would define these UX as a more generic approach. As for a technical proof of concept see https://github.com/johanhelsing/qt-csd-demo

It seems that the needed functionality is about to be included in Qt 5.15 (https://bugreports.qt.io/browse/QTBUG-73011)

ToxicDragon avatar Feb 12 '20 07:02 ToxicDragon

Qt 5.15 alpha was just released: https://www.qt.io/blog/qt-5.15-alpha-released

The qt-csd-demo mentioned in my last post was already updated aswell. I am really excited and hope this featere will be introduced in fluid soon ;)

ToxicDragon avatar Feb 14 '20 14:02 ToxicDragon

There is still something missing in Qt. As part of client-side decorations we want to draw drop shadows as a margin around the actual window contents, but there is no API to set this. For now we can implement client-side decorations in Fluid without drop shadows and wait for Qt 6, because Qt 5.15 is the last 5.x iteration and we can't add a new feature now.

plfiorini avatar Feb 14 '20 15:02 plfiorini

Sounds like a plan! Rome wasn't built in a single day aswell :) if I can help in any means but coding, please let me know

ToxicDragon avatar Feb 14 '20 15:02 ToxicDragon