Shadow problem after hiding/removing window decorations. ( Linux )



  • Hello everyone!
    I'm new to Qt and to this forum.

    I start playing around with Qt few months ago and I faced fallowing problem,

    I tried to hide window decorations ( I fallow this post "here":http://stackoverflow.com/questions/11775840/how-can-i-remove-borders-from-a-windows-qml-application ) and all works well apart form the fact that shadow are much thinner then on the same app but with system window decorations.
    It do not makes much different for me but designer I'm working on wants me to fix it and now I just run out of ideas.

    Shadow with system decoration:
    !http://ubuntuone.com/2iuN9WIIeHwCq8gQ5FaoHo(With decoration)!

    Shadow without decoration:
    !http://ubuntuone.com/4dbSOLJpMeCdGFaWD63Xif(Without decoration)!

    What I notices is that when decorations are hidden then shadow is the same as in the window which do NOT have currently focus.
    So it looks like when I hide decorations then application do not have focus and this is why shadow is thinner/lighter.

    Any ideas how to fix it ?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I don't want to be 100% affirmative, but it looks more like a window manager kind of "problem". The window manager being responsible for drawing the widgets/shadow/etc... I don't think that you can do much from Qt about that (but I would happy to be proven wrong)

    You might want to try also asking on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented)



  • Thank you for taking a time to respond to my post.
    It sounds like you are right... window manager "problem"

    I did few more tests and it turnout that there is no shadow on Gnome shell, and there is light shadow on Gnome fall-back mode ( same as on Unity ).
    I did send this message to mailing list as you suggested.

    Thanks for your help once again.
    Szymon
    [quote author="SGaist" date="1375565591"]Hi and welcome to devnet,

    I don't want to be 100% affirmative, but it looks more like a window manager kind of "problem". The window manager being responsible for drawing the widgets/shadow/etc... I don't think that you can do much from Qt about that (but I would happy to be proven wrong)

    You might want to try also asking on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented)[/quote]


  • Lifetime Qt Champion

    You're welcome !

    Don't forget to update this thread with any relevant information you might get so other users may reduce their search time if getting hit by the same problem :)

    Happy coding !



  • I answered a similar question "here":http://stackoverflow.com/a/15757358/1082289 about adding a shadow to a frameless window in Qt. May be you can use the same hack to solve this problem as well. : )



  • Hi,

    updated just noticed this topis is about Linux version.

    recently experienced similar issue with shadow decoration on Mac OS. And as already stated it is due to windows manager.

    Please see:
    @
    /// https://qt.gitorious.org/qt/qt/source/57756e72adf2081137b97f0e689dd16c770d10b1:src/gui/kernel/qwidget_mac.mm#L4905

    void QWidgetPrivate::finishCocoaMaskSetup()
    {
    // skipped
    if (q->isWindow()) {
    NSWindow *window = qt_mac_window_for(q);
    [window setOpaque:(extra->imageMask == 0)];
    [window invalidateShadow];
    }
    }
    @

    On Cocoa based GUI after widget has been hidden need to invalidate shadow.

    'setMask' on main widget should make a trick. Or (hack) expose a function that will do that for you as
    @
    // already available through Qt Gui:
    OSWindowRef window = qt_mac_window_for(w);
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.