Closed Bug 521582 Opened 15 years ago Closed 8 years ago

Qt: Backgrounds and borders missing

Categories

(Core Graveyard :: Widget: Qt, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: BenB, Assigned: heeen)

Details

Attachments

(4 files, 5 obsolete files)

Attached image Profile manager
Reproduction:
- hg mozilla-central trunk
- configure --enable-default-toolkit=cairo-qt
- make
- Start Firefox

Actual result:
- Widgets have no (white) background
- Widgets have no border

All browser UI is dark grey text on grey background. Textfields and listboxen have no background and no border. See attached screenshots.
Attached image Firefox main page
Severity: normal → critical
Severity: critical → major
Attached patch Fix some backgrounds ... (obsolete) — Splinter Review
... but segfaults on http://hg.mozilla.org/mozilla-central/file/120667a01fd2/layout/base/nsCSSRenderingBorders.cpp#l1176 quite frequently if TEXTFIELD* or LISTBOX is involved.

$ firefox https://forums.gentoo.org/
# shows up
# new tab
# enter url: google.de
# => segfault

Any ideas?
Attached patch update backgrounds (obsolete) — Splinter Review
though, needs a xul css hack, so that in preferences window the checboxes and radio buttons are not drawn by xul and native but only native.
Attachment #421015 - Attachment is obsolete: true
Attached patch hack xul css files (obsolete) — Splinter Review
I've updated Hanno Meyer-Thurow's patch.
Please note that my patch may not work (I've basically zero experience with mozilla's code)

Here's a small list of changes:
-it now compiles again
-I fixed a crash in DrawWidgetBackground (the code for NS_THEME_TAB was broken. A "break;" was missing. Additionally the original patch used QStyleOptionTabV* there - unfortunately this makes oxygen crash on KDE 4.4.5. I've replaced it by QStyleOptionTab.)

@Hanno Meyer-Thurow: could you please test if this still works for you as expected?
Also is it possible that setting "no background palette" for NS_THEME_MENUITEM is not correct?
adding myself
I removed bitrot from the above core patches and added a fix for explicit pixmap sharing in Qt. Otherwise most QPainter operations would have QPainter to copy the X11 pixmap internally and never show up on the destination pixmap.
This fixes menus being transparent for me, but checkboxes and radioboxes in chrome dialogs, eg. Preferences, are painted twice, once as Qt style and once as some other style.
Also menus seem to be drawn twice, causing noticeable flickering.
Assignee: nobody → florian.haenel
Attachment #421823 - Attachment is obsolete: true
Attachment #460055 - Attachment is obsolete: true
Status: NEW → ASSIGNED
After checking again, checkboxes and radioboxes look ok. There are some links in the preferences/privacy tab that are very hard to read in light gray on gray.
I just noticed popups are not painted at the right position if you force layer acceleration in about config.
Here I fixed the checkboxes/radiobuttons and tabs. No need to modify css files.
Attachment #421824 - Attachment is obsolete: true
Attachment #508763 - Attachment is obsolete: true
I investigated the actual drawing of the background some more, but I couldn't find a better solution than a crude fillRect.
A better solution would be to use DrawElement with PE_Widget or, in the case of popup menus, use the CE_MenuEmptyArea, but I just couldn't get them to work.
Tested this patch:
1) Menu borders still missing.
2) Menu items colored with blue color on mouse hover and that makes text invisible.

but it looks much better now.
This appears to depend on the QStyle that is in use. I found this whole drawing code to be very inconsistent. Some operations, like filling the empty area in menus just translate to no-ops in some styles.
I'm using default stlye, and that is looks bad, that means it will be bad for all users... I think top level menu items  should not be highlight-ed at all.
Comment on attachment 515046 [details] [diff] [review]
fixed theme on checkboxes and tabs

Ok, I checked blinking problem and found that it happens because we have multiple widgets created for popup menus + DIRECT_RENDERING mode enabled (which is rendering directly to X-Window avoiding Qt graphics scene clips/translates et.c.)
With double_buffer enabled it works fine because we are using qpainter correctly
Also it works with Qpainter backend, but that is just slow by itself.
So we have 3 ways to fix blinking:
1) Switch to buffered mode (at least for desktop where multiple widgets on scene)
2) Try to eliminate multiple nsWidget creation for menus/popups
3) Try to fix cairo-qt backend performance and font rendering problems.
Also it is a bit hard to review this patch, because it is not clear what for each change is needed and which testcase is that fixing... so0me stuff commented without explanation.
Would be nice to www.hevanet.com/acorbin/xul/top.xul and figure out which change fixing what.
In bug 1282866, I have removed the QT code from the Firefox tree with the approval of the active peer. That code is not currently maintained by any team.

I have looked through the bugs in the Widget: Qt bugzilla component and I believe all of these are no longer relevant because the Qt code has been removed. If you believe that this bug is still valid, please move it to another more appropriate bugzilla component as you reopen it.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: