Opened 10 years ago

Closed 10 years ago

#74 closed defect (fixed)

Popup windows cause widget duplication

Reported by: dmik Owned by:
Priority: blocker Milestone: Qt Beta 2
Component: QtGui Version: 4.5.1 Beta 1
Severity: Keywords:
Cc:

Description

If a popup window is shown at least once in a top-level window which layout is controlled by QLayout, subsequent resizing this window will produce visible duplicates of all child widgets contained in the window which will cause image distortion and mouse misalignment.

The effect may be seen in any top-level window with popups, for examile in QFileDialog, after opening the drop-down list of any of the comboboxes and resizing the file dialog.

Change History (4)

comment:1 Changed 10 years ago by dmik

  • Milestone changed from Qt GA to Qt Beta 2
  • Priority changed from major to blocker

I think I'm close to the solution so attaching it to Beta 2.

comment:2 Changed 10 years ago by dmik

The problem is fixed in r187. It was actually composed from two separate problems:

  1. QWidget::winId() was erroneously called when processing mouse messages in popup mode and caused a native window creation for all children that by default use the so-called alien widget mode (see Qt::WA_NativeWindow flag) which is faster and flickerless because no native windows are created for child widgets in this mode, they paint themselves directly to the top-level parent.child
  2. In native window mode, positioning of the child windows was shifted upwards by the height of the child (a typo in the y coordinate flipping code). As a result, we had a directly painted (alien) child at the right position and the native window for the same child widget right above it.

While the problem has gone now, it reveals that even when the native window mode is set (which can be forced at runtime with set QT_USE_NATIVE_WINDOWS=1 btw), child widgets continue to draw themselves directly to the parent at the same location (which is obstructed by the native window and thus not visible). It's obviously a time/cpu waste, but since native mode is OFF by default and since Win32 shows exactly the same behavior (I simulated the shift in its QWidgetPrivate::setWSGeometry) this looks like a cross-platform Qt bug-o-feature which I'm not going to fix (at least now) leaving this for Nokia.

comment:3 Changed 10 years ago by dmik

BTW, it's nice to see that fixing this problem fixed most of the menu and toolbar redraw problems in smplayer.

comment:4 Changed 10 years ago by dmik

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.