Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MousePressEvent not triggered if QWidget on top of Gnome left panel on Ubuntu 18.04
Forum Updated to NodeBB v4.3 + New Features

MousePressEvent not triggered if QWidget on top of Gnome left panel on Ubuntu 18.04

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 290 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kamui
    wrote on last edited by kamui
    #1

    Hello,

    Context : migrating from qt5.5 to qt 5.13.1

    As described on the title, I don't receive mouse press if I click on the part of the QWidget that is overlapping the gnome left panel. If I click just on the right part that is not exactly on top of the gnome panel, the mousePressEvent is triggered (as shown below)

    Any Idea of what I'm missing in terms of WindowFlags ?

    Capture d’écran de 2019-11-06 14-18-20.png

    Here's what is set for the QgraphicsView the QWidget is attached to :

        mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
    #ifdef Q_OS_OSX
        mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
    #endif
        mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint | Qt::Window | Qt::NoDropShadowWindowHint);
        mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);
        mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height());
        mTransparentDrawingView->setMouseTracking(true);
        mTransparentDrawingView->setAcceptDrops(true);
    
    
    JonBJ 1 Reply Last reply
    0
    • K kamui

      Hello,

      Context : migrating from qt5.5 to qt 5.13.1

      As described on the title, I don't receive mouse press if I click on the part of the QWidget that is overlapping the gnome left panel. If I click just on the right part that is not exactly on top of the gnome panel, the mousePressEvent is triggered (as shown below)

      Any Idea of what I'm missing in terms of WindowFlags ?

      Capture d’écran de 2019-11-06 14-18-20.png

      Here's what is set for the QgraphicsView the QWidget is attached to :

          mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
      #ifdef Q_OS_OSX
          mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
      #endif
          mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint | Qt::Window | Qt::NoDropShadowWindowHint);
          mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);
          mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height());
          mTransparentDrawingView->setMouseTracking(true);
          mTransparentDrawingView->setAcceptDrops(true);
      
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @kamui said in MousePressEvent not triggered if QWidget on top of Gnome left panel on Ubuntu 18.04:

      Context : migrating from qt5.5 to qt 5.13.1

      But the GNOME version has stayed the same across your migration of Qt versions? Because it feels like it might be GNOME behaviour?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kamui
        wrote on last edited by kamui
        #3

        To be honest I never tried to compile my app with Qt 5.5 on Ubuntu 18.04.

        The issue was not showing on Ubuntu 16.04 (unity) on Qt 5.5, but is showing on Ubuntu 18.04 (gnome) (but OK in KUbuntu 18.04 as no left panel is under my QWidget) with Qt 5.9, 5.13.

        With Qt::X11BypassWindowManagerHint set, I'm not sure I can say it is a bad gnome behavior, or an unexpected one on Qt-side as the Window manager is supposed to be bypassed...

        At least, I think it is comfortable to say it is gnome-related...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved