Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt4: Window appears in the upper left corner on metacity
Qt 6.12 LTS is out! See what's new in the release blog

Qt4: Window appears in the upper left corner on metacity

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 658 Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have a problem with window appearance in qt4 on Metacity. Initial problem was with the window appearing under another window, from which it was called by clicking the button. I solved that on Compiz by sending _NET_ACTIVE_WINDOW, but on metacity it still wasn't working. After hours of googling, I tried this:

    if (window -> isMinimized())
    {
    window -> showNormal();
    }
    else if (window -> isHidden())
    {
    window -> show();
    }

    //the code that I added, which makes the window appear above.

    window ->setWindowFlags(Qt::WindowStaysOnTopHint);
    Qt::WindowFlags flags = window->windowFlags();
    flags &= ~Qt::WindowStaysOnTopHint;
    window->setWindowFlags(flags);

    window->setGeometry(window->geometry());

    window -> activateWindow();
    window->show();
    window -> raise();

    It is just workaround, but it actually makes the window appear above. And this is where another problem occurs: If the window is shown and I change the focus to the window from where it is called and press the button, my window appears above on the same place as it should. But if I close the window and call it again, it appears in the upper left corner. Does anyone have an idea why it is happening? Thanks in advance.

    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
    • Unsolved