Results 1 to 8 of 8

Thread: Translucent frameless window problem on Kubuntu

  1. #1
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Translucent frameless window problem on Kubuntu

    I have the main window transparent and frameless, inside i have a rounded border widget. This works perfectly fine on Windows, but when i run it on Kubuntu the mainwindow is painted with a blured grey. The translucency works only if i remove the Qt::FramelessWindowHint. (Qt 4.74 on Kubuntu 11.04)

    source:
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QWidget(parent, Qt::FramelessWindowHint)
    3. {
    4. ui.setupUi(this);
    5.  
    6. this->setAttribute(Qt::WA_TranslucentBackground,true);
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    Why could this be happening? I need the main window to be frameless and translucent in order to give my application a rounded look and feel.

  2. #2
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Translucent frameless window problem on Kubuntu

    this->setAttribute(Qt::FramelessWindowHint)ï¼›

  3. #3
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Translucent frameless window problem on Kubuntu

    Hey, im not with a kubuntu box right now, but i'll try it later. Have you tried?
    I can't see how this would solve the problem, the flag Qt::FramelessWindowHint in the QWidget constructor is working since i get a frameless window. The problem is that the widget gets painted wiht grey, instead of been transparent(i didnt apply any style or background color)

    anyway i'll give it a try when im back home.
    thanks!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Translucent frameless window problem on Kubuntu

    A frameless window is probably held out of grasp of the window manager hence your window manager (kwin, I guess) cannot detect the window is translucent and the effects you have enabled for kwin treat your window as opaque, drawing the shadow under the whole area of the window. That's only a guess but I think a pretty good one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Translucent frameless window problem on Kubuntu

    I see what u mean. The window also loses all the effects of dragging windows, applied on window manager config. I tried running a normal program on kubuntu, removing borders with the window options, and the same happened, dragging effect of windows disappeared.

    Is there anyway of letting the window manager know about our frameless window, in order to use the translucency, without loosing all desktop effects?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Translucent frameless window problem on Kubuntu

    Don't disable the frame. You can try masking it out (using setMask) however I have no idea whether kwin will be able to detect the mask.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Translucent frameless window problem on Kubuntu

    I dont really know how to use the masking or paint methods...
    Is there any tutorial or guide for masking actions and use of QPixmaps? im interested in changing widget's shape and making transparent areas, but i cant find a tutorial or examples to that. That would be pretty usefull!

    thanks for your help!

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Translucent frameless window problem on Kubuntu

    Open Qt Assistant (or Qt Creator help pane), go to "index" tab and type in "setMask".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Frameless Window Helper
    By nish in forum Qt-based Software
    Replies: 6
    Last Post: 20th February 2011, 07:28
  2. Replies: 10
    Last Post: 25th October 2010, 23:59
  3. Resize handling of frameless window
    By Peppy in forum Qt Programming
    Replies: 5
    Last Post: 2nd June 2010, 20:48
  4. Translucent window background in 4.3.2 - possible?
    By dpimka in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2009, 08:53
  5. KWin's shadows and frameless window
    By EuroElessar in forum KDE Forum
    Replies: 4
    Last Post: 12th July 2009, 16:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.