Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI rendering issues with macOS Big Sur #5663

Closed
The-Compiler opened this issue Aug 11, 2020 · 33 comments
Closed

UI rendering issues with macOS Big Sur #5663

The-Compiler opened this issue Aug 11, 2020 · 33 comments
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: ui Issues related to the user interface. os: macOS Issues which only happen on macOS. priority: 1 - middle Issues which should be done at some point, but aren't that important. qt Issues related to the Qt framework.
Milestone

Comments

@The-Compiler
Copy link
Member

Tried latest qtbrowser on the macOS Big Sur public beta (now available at beta.apple.com) and there are some details to adjust:

  • command bar background colour seems locked to white
  • when hitting 'f' the background of the hints is gone

Originally posted by @danielfalbo in #5662

@The-Compiler The-Compiler added bug: behavior Something doesn't work as intended, but doesn't crash. component: ui Issues related to the user interface. os: macOS Issues which only happen on macOS. priority: 2 - low Issues which are currently not very important. qt Issues related to the Qt framework. labels Aug 11, 2020
@The-Compiler
Copy link
Member Author

This is most likely something Qt will need to fix, but it'd be good to have some more minimal example code ready to report it upstream.

I didn't find anything in the Qt bugtracker yet, only a tracking task and an unrelated QTabBar issue.

@danielfalbo Do you happen to have screenshots so I get a better idea of what's going on? I can't easily test this right now, as I don't want to upgrade the Mac I use to create packages.

@danielfalbo
Copy link

Of course!
Screenshot 2020-08-11 at 14 55 06
Screenshot 2020-08-11 at 14 55 39
Screenshot 2020-08-11 at 14 55 56
all taken with empty config.py (i.e. default settings)

@danielfalbo
Copy link

Screenshot 2020-08-11 at 15 00 18
Screenshot 2020-08-11 at 15 00 44
Screenshot 2020-08-11 at 15 01 03
instead these screenshots were taken with a gruvebox theme

@The-Compiler
Copy link
Member Author

Thanks! That's interesting - it looks like qutebrowser's styling via Qt stylesheets isn't being applied at all. If you launch qutebrowser via something like:

/Applications/qutebrowser.app/Contents/MacOS/qutebrowser --temp-basedir

from a terminal, do you see any warning or so printed?

@danielfalbo
Copy link

Yes! objc[46299]: Class QMacAutoReleasePoolTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x10af410f8) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1088ca0f8). One of the two will be used. Which one is undefined. objc[46300]: Class QMacAutoReleasePoolTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1142f70f8) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10608f0f8). One of the two will be used. Which one is undefined. objc[46300]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1142f7170) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10608f170). One of the two will be used. Which one is undefined. objc[46299]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x10af41170) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1088ca170). One of the two will be used. Which one is undefined. objc[46300]: Class KeyValueObserver is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1142f7198) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10608f198). One of the two will be used. Which one is undefined. objc[46299]: Class KeyValueObserver is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x10af41198) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1088ca198). One of the two will be used. Which one is undefined. objc[46300]: Class RunLoopModeTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1142f71e8) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10608f1e8). One of the two will be used. Which one is undefined. objc[46299]: Class RunLoopModeTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x10af411e8) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1088ca1e8). One of the two will be used. Which one is undefined. QCoreApplication::applicationDirPath: Please instantiate the QApplication object first

@The-Compiler The-Compiler changed the title UI rendering issues with macOS Bien Sur UI rendering issues with macOS Big Sur Aug 11, 2020
@The-Compiler
Copy link
Member Author

I think those are unrelated (#4919) - here's a minimal example using a Qt style sheet:

import sys
from PyQt5.QtWidgets import QApplication, QLabel
from PyQt5.QtCore import Qt

app = QApplication(sys.argv)
label = QLabel()

if '--styled' in sys.argv:
    print("setting attribute")
    label.setAttribute(Qt.WA_StyledBackground)

label.setText("Hello World")
label.setStyleSheet("background-color: red; color: blue")
label.show()

app.exec_()

I built that into a quick .app (inside a .zip because I couldn't figure out how to quickly create a dmg): https://www.qutebrowser.org/tmp/styled.zip

Could you please try that and see if it's blue on red? If not, can you start it from the terminal again with the additional argument (styled.app/Contents/MacOS/styled --styled) and see if that makes any difference?

@danielfalbo
Copy link

Downloaded styled.app and and it won't even start! Neither from Finder nor from cli

@The-Compiler
Copy link
Member Author

Meh, weird. Worked for me on macOS High Sierra, but it was mostly a quick & dirty thing. I'll see if I can give this a try myself somehow, but it's likely going to take a while.

@danielfalbo
Copy link

As long as Big Sur it's just in beta, it's not a big issue 👍 Thanks

@donaldguy
Copy link

@The-Compiler Big Sur is now slated for release tomorrow

might be worth bumping priority here :-)

@The-Compiler
Copy link
Member Author

The-Compiler commented Nov 11, 2020

Not much qutebrowser can do here - most likely, this will need to be fixed in Qt. Looks like there were a couple of related fixes, so with a bit of luck, things will already look better with Qt 5.15.2 (which will end up in the next qutebrowser release once it's released, likely this week).

@The-Compiler The-Compiler added priority: 1 - middle Issues which should be done at some point, but aren't that important. and removed priority: 2 - low Issues which are currently not very important. labels Nov 11, 2020
@donaldguy
Copy link

donaldguy commented Nov 11, 2020

giving it a look, will post results

(EDIT: currently waiting on qtwebengine/src/3rdparty chromium submodule clone ... 😅 )

(EDIT 4 8 hours later: I haven't gotten a brew install qt --head build to go through yet, un-shockingly; not that I've been constantly trying)

EDIT 3: After 9 hours intermittently fighting to actually do a "normal" install --head build from dev branch I am now attempting a build from the 5.15.2 branch ; I have regrets (dev is currently apparently a mix of 5 and 6 dotted modules, and is also maybe ~half-converted to using cmake, or using cmake differently... ?)

@donaldguy
Copy link

I got it to build from source as below, to no apparent difference - except I did discover (briefly thinking I hadn't wasted my time) that the issue is more dynamic than thus far described!

its sensitive to OS dark mode!! 🙀 :

This appears to be the same for my build and the current shipped binary (installed via brew cask; or maybe that cask version is sneakily loading new Qt? but I don't think so?)

Screens

Dark mode - white on black completions, white on nothing hints

Light mode – white on white completions, black on nothing hints

My Build

... Reminded me why I use macOS vs e.g. Arch or Gentoo (and mostly do web dev and YAML-y devops on it) 😅 ...

# 1. point head at the right branch 
sed -i '' -e 's/branch: "dev"/branch: "5.15.2"/' $(brew formula qt)
# 2. the formula's patch on qt3d failed, but I doubt we care for qutebrowser; 
# (and it may have merged upstream anyway?).  At this writing, its the only patch
#  in the formula so we just kill with fire 🔥
sed -i '' -e '/patch/,/end/d' $(brew formula qt)
# 3. Tell brew to tell chromium its okay that the OS SDK is 11.0 before make, probs could/should 
# be a proper brew `patch`, `inreplace`, or an overwite of the whole find_sdk.py script from chromium upstream 
# but ¯\_(ツ)_/¯ ... why _not_ write shell-quoted perl to write ruby to run sed to (3 chars) change a single line of python?!
perl -i'' -npe 'print qq(\n$1system "bash", "-c", "sed -i'"'' -e '"'s/\\\\^MacOSX\(10/^MacOSX\(1\\\\\\\\d/'"'"' qtwebengine/src/3rdparty/chromium/build/mac/find_sdk.py"\n) if m?(\s+)system.*make?' $(brew formula qt)

# add -v if, like me, you prefer extreme chattiness to long silent pauses in your builds
brew install qt --head

# so many submodules ... https://youtu.be/YUKmq7UMJys

Then

export LDFLAGS="-L$(xcrun --show-sdk-path)/usr/lib"
asdf install python 3.8.6 # asdf-vm.com
unset LDFLAGS
git clone https://github.com/qutebrowser/qutebrowser.git && cd qutebrowser
asdf local python 3.8.6
asdf reshim
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/zlib/lib/pkgconfig:/usr/local/Cellar/qt/HEAD-883da72/lib/pkgconfig"
export PATH="/usr/local/Cellar/qt/HEAD-883da72/bin:$PATH"
# python3 ./scripts/mkvenv.py --pyqt-type source -- got pretty far but eventually failed
# as 
#  Installing build dependencies ... done
#   Running command /Users/donald/qutebrowser/.venv/bin/python /Users/donald/qutebrowser/.venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/14/0j3l9vm90yl017174clrk5mr0000gn/T/tmpqern7mjs
#   Getting requirements to build wheel ... done
#     Created temporary directory: /private/var/folders/14/0j3l9vm90yl017174clrk5mr0000gn/T/pip-modern-metadata-epyqawq1
#     Running command /Users/donald/qutebrowser/.venv/bin/python /Users/donald/qutebrowser/.venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/14/0j3l9vm90yl017174clrk5mr0000gn/T/tmpc5vm0c67
#     Querying qmake about your Qt installation...
#     /usr/local/Cellar/qt/HEAD-883da72/bin/qmake -query
#     These bindings will be built: QtWebEngineCore, QtWebEngine, QtWebEngineWidgets.
#     Generating the QtWebEngineCore bindings...
#     _in_process.py: Unable to find file "QtCore/QtCoremod.sip"
# and then seems to throw away ~all its progress :/ - so trying it at the global level now
pip install -U pip
pip install PyQt5 --verbose
pip install PyQtWebEngine --verbose
python3 ./scripts/mkvenv.py --pyqt-type link

where also:

❯ sw_vers
ProductName:	macOS
ProductVersion:	11.0.1
BuildVersion:	20B5022a
# I believe this is RC1 of 11.0.1; upgrade for RC2 is pending for me right now, but I am
# too much actively using my comp to roll forward; & I think tomorrow's GA is justh for 11.0.0 anyway ?

❯ xcode-select -p
/Applications/Xcode-beta.app/Contents/Developer

❯ plutil -p /Applications/Xcode-beta.app/Contents/Info.plist | grep -i 'version.*=>'
  "CFBundleInfoDictionaryVersion" => "6.0"
  "CFBundleShortVersionString" => "12.2"
  "CFBundleVersion" => "17518"
  "DTPlatformVersion" => "11.0"
  "LSMinimumSystemVersion" => "10.15.4"
          "NSExtensionVersion" => "1.0"
          "NSExtensionVersion" => "1.0"

❯ (cd /Users/donald/Library/Caches/Homebrew/qt--git && git rev-parse HEAD)
883da721dbc989b6f08fea2179cfbd1ecbe13692

❯ (cd  ~/Library/Caches/Homebrew/qt--git && git submodule status --recursive)
 34171b1d99f55fde1627df3c57eed50480ab2ae7 qt3d (v5.15.0-70-g34171b1d9)
 0c62d8262fb2a4779e05e95d112f08125031b640 qtactiveqt (v5.15.0-11-g0c62d82)
 505be55243ba1600f62f47f9be3011a717841096 qtandroidextras (v5.15.0-12-g505be55)
 40143c189b7c1bf3c2058b77d00ea5c4e3be8b28 qtbase (v5.15.0-669-g40143c189b)
 1319e0965f6008f44f9216a7bb76e106a1710767 qtcanvas3d (v5.12.0-16-g1319e09)
 a67f812548b008e3eedcd2bb9313828a195fd23b qtcharts (v5.15.0-9-ga67f8125)
 ca6cc606d9fc0947ea6c27738a1ca8f12f3258ea qtconnectivity (v5.15.0-11-gca6cc606)
 1168c788a117e4556e6cd0ba1e267a86ef62b0c4 qtdatavis3d (v5.15.0-6-g1168c788)
 104eae5b17b0ec700391e9539ee3a4f638588194 qtdeclarative (v5.15.0-176-g104eae5b17)
 6b0c42c63c2492bd0a7a96d3179d122b5f71793f qtdeclarative/tests/auto/qml/ecmascripttests/test262 (6b0c42c63)
 7afacb76c81cee87aef9f539f55b8964bd550945 qtdoc (v5.15.0-34-g7afacb76)
 e36e6f0abd45c2794c70c31eb10c5263e7e7a29a qtdocgallery (e36e6f0)
 9ac8d8c272fc93416016e094fc6b97226a400082 qtfeedback (v5.0.0-beta1-28-g9ac8d8c)
 ff933a4e72826a77c81c4153f1adcf765ead35f0 qtgamepad (v5.15.0-6-gff933a4)
 66b7fbaca4b323dce337e87e3093c8836577c561 qtgraphicaleffects (v5.15.0-9-g66b7fba)
 74a5bc4a45195b876454e596e76cb23aeb365410 qtimageformats (v5.15.0-11-g74a5bc4)
 02a21217a9706402802f38c646797be8eccb86e4 qtlocation (v5.15.0-19-g02a21217)
 d3101bbc22edd41c9036ea487d4a71eabd97823d qtlocation/src/3rdparty/mapbox-gl-native (android-v4.1.1-1942-gd3101bbc2)
 b182dcd78a35b4667b2568857b7719d555c7fddb qtlottie (v5.15.1-1-gb182dcd)
 65f500c488c593486c6c390f53497dfbce1b58a6 qtmacextras (v5.15.0-7-g65f500c)
 fd30913d4601d12437404e1d20113a1ed6364ccc qtmultimedia (v5.15.0-28-gfd30913d)
 fb2d6d47a0c961278d63309789a1141c3734818b qtnetworkauth (v5.15.1-6-gfb2d6d4)
 02efef5ee63bf2407526f81fd6b68f5a59ac1de3 qtpim (v5.0.0-beta1-191-g02efef5e)
 ddfa4d16243128d2871a51c513e025d518151b17 qtpurchasing (v5.15.0-6-gddfa4d1)
 e8b1cc0b130976a7a60cd3b5c08a6355b089ae77 qtqa (v5.0.0-beta1-627-ge8b1cc0)
 2e05e6d6546635a8f25882c5140fb17697be0062 qtquick3d (v5.15.0-57-g2e05e6d6)
 8f0c6b04b2257a520aaab38421b2e090204b69df qtquick3d/src/3rdparty/assimp/src (Release3.1_RC1-5812-g8f0c6b04)
 7c29283041a50def3ceca7de4471f211c9b30d4e qtquickcontrols (v5.15.0-12-g7c292830)
 16f27dfa3588c2bf377568ce00bf534af48c9558 qtquickcontrols2 (v5.15.0-51-g16f27dfa)
 147ad75c589fc4804429710fdb177cc48a80dbea qtquicktimeline (v5.15.0-5-g147ad75)
 8e889442508e284691c923470eb4552c96afdfe3 qtremoteobjects (v5.15.0-9-g8e88944)
 ee34618d9f94e0cb6f678140e6cd2916308531b5 qtrepotools (v5.0.0-beta1-462-gee34618)
 5da7de1800eee3d604eb7e787b114479b61ffc93 qtscript (v5.15.0-9-g5da7de1)
 95aa78be795a862b95371afa75e1417029ec0a16 qtscxml (v5.15.0-9-g95aa78b)
 5618198e6df5e0224f79f786a44af7527b431545 qtsensors (v5.15.0-7-g5618198)
 1aa9b03756baead139943712839af5ecedeb2989 qtserialbus (v5.15.0-8-g1aa9b03)
 192e376b01e65e7277772bdc94106613c22cf531 qtserialport (v5.15.0-7-g192e376)
 84dd22a080014cb99a7dff7772990787a04ca533 qtspeech (v5.15.0-10-g84dd22a)
 52d3788c7b0116ea3db232dccca5f1e3f1e229ac qtsvg (v5.15.0-32-g52d3788)
 434af789f0d56ca7a521ca2d9ec8cf3b1057fd37 qtsystems (v5.0.0-beta1-133-g434af78)
 cc52debd905e0ed061290d6fd00a5f1ab67478a5 qttools (v5.15.0-61-gcc52debd)
 cb1857418b36780b0444333f3aa6250ca3780f19 qttranslations (v5.15.1-1-gcb18574)
 7b90415c58dd02c682a9ba317f273d7b3398ff88 qtvirtualkeyboard (v5.15.0-13-g7b90415)
 3cc17177b1b03053276eb6236fda137c588261a7 qtwayland (v5.15.0-32-g3cc17177)
 90cffd49575b075b0dc28440c693753d860fee87 qtwebchannel (v5.15.0-9-g90cffd4)
 35c7e9134a1a5e0390c42ea2df06a749255497ff qtwebengine (v5.15.1-42-g35c7e913)
 fb6ab5e483876298235be1c6a6013b426c82b759 qtwebengine/src/3rdparty (remotes/origin/83-based)
 5e41e564aaf96b7e49403af5099995efbe4cac8e qtwebglplugin (v5.15.0-7-g5e41e56)
 f73735911b2124ef16aa39228bf8f89ee900ba5d qtwebsockets (v5.15.0-10-gf737359)
 800926cc4e0ecfdb37a3b34486403354b66a37a4 qtwebview (v5.15.0-9-g800926c)
 41f2492a30be21f28c8b0b7b932b886536fc9916 qtwinextras (v5.15.0-7-g41f2492)
 9bb0adeac84da6723cf57a2bb0d0c3b405691a15 qtx11extras (v5.15.0-7-g9bb0ade)
 50421402f05b3ee3c76c6cff455a69efaf576b6d qtxmlpatterns (v5.15.0-8-g50421402)
 ddfcd98e8d3f78d696bb25ddcaacc3e3cba51e7f qtxmlpatterns/tests/auto/3rdparty/testsuites (heads/master)

@The-Compiler
Copy link
Member Author

@donaldguy Thanks for your in-depth investigation! However, you will need to build PyQt from source - if you do pip install PyQtWebEngine, that includes a Qt 5.15.1 binary and doesn't use your custom-built one.

You can confirm that by using :version - you'll likely see Qt 5.15.1 with Chromium 80 (rather than 83) as backend. The "Qt library executable path" will also point to some location inside the installed PyQt.

@donaldguy
Copy link

Seems like its got the 5.15.2 build

https://paste.the-compiler.org/view/8dcfbb4a

But I admit its not super clear to me, cause on the one hand:

❯ cat ~/.asdf/installs/python/3.8.6/lib/python3.8/site-packages/PyQtWebEngine-5.15.1.dist-info/WHEEL
Wheel-Version: 1.0
Generator: _in_process.py 5.4.0
Root-Is_Purelib: false
Tag: cp35.cp36.cp37.cp38.cp39-abi3-macosx_10_13_x86_64

but on the other

 ~/qutebrowser   master ?1 ·····························································  3.8.6
❯ otool -L .venv/lib/python3.8/site-packages/PyQt5/QtWebEngine.abi3.so
.venv/lib/python3.8/site-packages/PyQt5/QtWebEngine.abi3.so:
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtWebEngine.framework/Versions/5/QtWebEngine (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.15.0, current version 5.15.2)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2012.102.0)
	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 244.32.1)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtQmlModels.framework/Versions/5/QtQmlModels (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.15.0, current version 5.15.2)
	/usr/local/Cellar/qt/HEAD-883da72/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.15.0, current version 5.15.2)
	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)

so it seems to be linked right but the sos and sips seem maybe pre-fab (I thought I remembered them building but I might be confused)

I'll try going through that

@The-Compiler
Copy link
Member Author

Based on that version output, it seems to me like things should be fine. Since you have a development setup up and running, could you please test my test script from #5663 (comment) as well?

@donaldguy
Copy link

donaldguy commented Nov 12, 2020

Looks to work:

Screen Shot 2020-11-12 at 4 47 59 PM

Sorry for being somewhat slow on the response

EDIT: Its likely presumed and partially caught in the screenshot (in the title bar), but I meant to leave in view (on prompt)— but inadvertently cut out via https://github.com/romkatv/powerlevel10k/blob/feaf120ddc25279d6efa52ef4aecb7d14504064f/config/p10k-pure.zsh#L162— that this shell was cwd of qutebrowser/.venv

EDIT 2: No significant difference that I see with/without --styled:

Screen Shot 2020-11-12 at 5 00 56 PM

my eyes suggest maybe a difference in font weight but I think thats just ... ~projection

@The-Compiler
Copy link
Member Author

The-Compiler commented Nov 12, 2020

Hmm, okay. The way used to style the hint labels isn't terribly different to that example... I'll try if I can cook up a more complex example closer to how hints actually work, but this isn't really on the top of my priorities at the moment - I only have access to a Mac running High Sierra, and I only use Linux personally, so macOS/Windows support is mostly "best effort".

@donaldguy
Copy link

donaldguy commented Nov 12, 2020

I totally understand, and for what its worth, I personally am so far mostly actually using qutebrowser on my MBP that's still on Catalina for the time being (cause its also running with yabai–and though their Big Sur issue is ~cleared, I'm skeptical), but ... my upgrade finger will get itchy before too long

I think there is definitely probably some disjoint between the "early upgrader" mac power user persona and the "target audience for qutebrowser" power user persona. I'm just special 🙃 (and so too, apparently, is danielfalbo )

Hopefully Qt 5.15.2 release and/or Qt6 stuff will sweep it all by the wayside


But yeah - though I had seen your browser mentioned in some privacy-focused blog post not too far back I was skeptical of venturing out of Big 3 (+ Brave & Vivaldi), what brought me here was encountering bindings here: https://github.com/koekeishiya/skhd/blob/master/examples/skhdrc#L100-L112

so I think you know already, but your mac users are definitely out here!

(and alternatives are similarly encumbered by the disjoint and understandable linux-user bias. see e.g. Jelmerro/Vieb#87 )

Don't forget us if/when Bruhin exists more, especially if it eventually has multiple employees 😀


Also, for what its worth, I pretty recently bought an Apple Developer Program subscription for the first time for no particularly good reason, and would be potentially down to sign the binaries (and even ship to Mac App Store if it'd pass sandbox muster, and thats at all desirable);

I don't presume the 90 Fr./yr fee is the (primary) reason you aren't doing that, but if it is ...

@EeJM
Copy link

EeJM commented Nov 13, 2020

On Big Sur version 11.0.1 (20B29)

For me whenever I right click anywhere inside of qutebrowser, it hangs and won't work until I force quit it and restart it.

When I launch it with --temp-basedir the renderer immediately crashes and continues to do so if I try to open any page (including stuff like :version).

% /Applications/qutebrowser.app/Contents/macOS/qutebrowser --temp-basedir 17:05:59 WARNING: Qt WebEngine resources not found at /Applications/qutebrowser.app/Contents/macOS//Applications/qutebrowser.app/Contents/macOS. Trying parent directory... 17:05:59 WARNING: Qt WebEngine resources not found at /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt. Trying application directory... 17:05:59 WARNING: Installed Qt WebEngine locales directory not found at location /Applications/qutebrowser.app/Contents/macOS//Applications/qutebrowser.app/Contents/macOS/qtwebengine_locales. Trying application directory... objc[14118]: Class QMacAutoReleasePoolTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x118f8c178) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10aaf2178). One of the two will be used. Which one is undefined. objc[14118]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x118f8c1f0) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10aaf21f0). One of the two will be used. Which one is undefined. objc[14118]: Class KeyValueObserver is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x118f8c218) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10aaf2218). One of the two will be used. Which one is undefined. objc[14118]: Class RunLoopModeTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x118f8c268) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x10aaf2268). One of the two will be used. Which one is undefined. objc[14117]: Class QMacAutoReleasePoolTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1042b5178) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x101c3e178). One of the two will be used. Which one is undefined. objc[14117]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1042b51f0) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x101c3e1f0). One of the two will be used. Which one is undefined. objc[14117]: Class KeyValueObserver is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1042b5218) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x101c3e218). One of the two will be used. Which one is undefined. objc[14117]: Class RunLoopModeTracker is implemented in both /Applications/qutebrowser.app/Contents/MacOS/QtCore (0x1042b5268) and /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x101c3e268). One of the two will be used. Which one is undefined. Qt WebEngine resources not found at . Trying parent directory... Qt WebEngine resources not found at /Applications/qutebrowser.app/Contents/MacOS/PyQt5/Qt. Trying application directory... QCoreApplication::applicationDirPath: Please instantiate the QApplication object first Qt WebEngine resources not found at . Trying fallback directory... The application MAY NOT work. Installed Qt WebEngine locales directory not found at location /qtwebengine_locales. Trying application directory... QCoreApplication::applicationDirPath: Please instantiate the QApplication object first Qt WebEngine locales directory not found at location /qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct. [1113/170600.866725:ERROR:icu_util.cc(199)] Couldn't mmap icu data file 17:06:01 ERROR: Renderer process crashed

@aldorgan
Copy link

I have encountered the same kinds of problems as other's have in this issue on upgrade to Big sur. White text and qutebrowser is hanging on right-clicks and i need too force shutdown qutebrowser and restart it.

@donaldguy
Copy link

donaldguy commented Nov 13, 2020

No issue with right-clicks on the one I built from (probably slightly old now) git branch qt 5.15.2

I don't wanna spend too long on it, since as I mentioned my own qutebrowser usage is currently still mostly on Catalina - but I will give running the build_release script a go and see if I can get a slightly-better working .app to post here

(if I manage: the completion/command menu looks fine white on black, (only) in OS dark mode ; hints are white text with no background tho, so you will have to do / + Return [or use a mouse 🙀 ])

EDIT T+30m:
(so far trying to make packaged Qt wheels to include; it might be better if I just copied my so's and manually adjusted the rpath - but idk if I wanna be that finicky)

EDIT T+1h: I'm not really a python person, so what exactly the pyqt-bundle helper wants from me as a positional argument is a little unclear. I'm trying/tried to crib from the usage in https://github.com/qutebrowser/qutebrowser/blob/master/scripts/dev/build_pyqt_wheel.py but pip download (despite --only-binary; did a source build and/but) doesn't give me any apparent whls to patch (just tarballs - which I considered for a second might be secret wheels, but right off the bat I see that PEP 427 specifies wheels as zips – maybe if I read more conversion to whl will jump out at me) – I assume cause the OS version is failing the match against the PyQt5-5.15.1-5.15.1-cp35.cp36.cp37.cp38.cp39-abi3-macosx_10_13_intel.whl thats up there (which I could just download and patch directly I suppose?)

EDIT T+3h: This has crossed into the "spend too long on it" that "I [did]n't want to".

I might still post something but no promises; feel free to try my build instructions above yourself

@The-Compiler
Copy link
Member Author

@donaldguy Thanks again for all the effort you put into this - as soon as Qt 5.15.2 is released (apparently "later this week" if no new surprises turn up), I'll be able to upload an updated .dmg with almost zero effort 😉 FWIW whl files are indeed ZIPs with binaries in them, while tarballs are usually used for source-distributions. It's weird that you'd get tarballs with --only-binary :all: or so, but no idea what's going on exactly - anyways, I'd suggest just waiting until Qt 5.15.2 is actually out.

Let's split this discussion up a bit, because we're talking about various different things now:


Could people affected by this please try creating a ~/.qutebrowser/config.py with something like:

import os
config.load_autoconfig()
os.environ['QT_MAC_WANTS_LAYER'] = '1'

and see if that changes anything about either the rendering issues or the context menu hang (#5896)?

@maxime-michel
Copy link

The above snippet takes care of the crashes on right-click, but doesn't help with rendering issues, as far as I can tell. However, in my case the rendering issues are being hidden by the following style block:

c.fonts.tabs.selected = '14pt monospace'
c.fonts.tabs.unselected = c.fonts.tabs.selected
c.fonts.completion.entry = c.fonts.tabs.selected
c.fonts.debug_console = c.fonts.tabs.selected
c.fonts.downloads = c.fonts.tabs.selected
c.fonts.keyhint = c.fonts.tabs.selected
c.fonts.messages.error = c.fonts.tabs.selected
c.fonts.messages.info = c.fonts.tabs.selected
c.fonts.messages.warning = c.fonts.tabs.selected
c.fonts.statusbar = c.fonts.tabs.selected
c.fonts.hints = 'bold 14pt monospace'
c.fonts.completion.category = c.fonts.hints
c.fonts.prompts = '14pt sans-serif'

In other words, I had never seen them before I tried to comment this out.

@The-Compiler
Copy link
Member Author

Ah, that might just be the missing piece of the puzzle!

Could you run /Applications/qutebrowser.app/Contents/macOS/qutebrowser --temp-basedir --loglevel vdebug --logfilter config (not sure if I got the path correct) and show all the "stylesheet for ..." logging messages there?

@The-Compiler
Copy link
Member Author

I managed to get that information via CI, I must've missed that GitHub Actions has Big Sur support since quite a while.

It looks like the default system monospace font we get changed from Monaco to .AppleSystemUIFontMonospaced, thus resuting in font: 10pt .AppleSystemUIFontMonospaced; in the stylesheet. The leading dot in that breaks stylesheet parsing, and thus all the custom styling qutebrowser does.

Not sure yet whether this return value is expected (though it definitely is strange) and we just need to quote it in the stylesheet, or whether this is a Qt bug of some sorts and we shouldn't get that value at all.

Could someone paste this into :debug-console (need to copy/paste line by line, unfortunately):

from PyQt5.QtWidgets import QLabel
label = QLabel()
label.setText("Hello World")
label.setStyleSheet('background-color: #770000; font: 10pt ".AppleSystemUIFontMonospaced"')
label.show()

or alternatively, run the following standalone script:

from PyQt5.QtWidgets import QApplication, QLabel

app = QApplication(sys.argv)
label = QLabel()

label.setText("Hello World")
label.setStyleSheet('background-color: #770000; font: 10pt ".AppleSystemUIFontMonospaced"')
label.show()

app.exec_()

and let me know whether you:

  1. get a dark red background
  2. get a monospaced font

@The-Compiler
Copy link
Member Author

Ah, actually this reminds me of #5206 - so it'd be good if you could launch qutebrowser (or the script) in the console and also see if you get a "All system UI font access should be through proper APIs" warning when testing the script above.

Maybe Qt will need another fix similar to:

@maxime-michel
Copy link

maxime-michel commented Nov 18, 2020

I ran the script in qutebrowser with my custom config (including both my styles and the snippet to fix the crashes on right-click), and I got both the dark red background and the monospaced font.

and also see if you get a "All system UI font access should be through proper APIs" warning when testing the script above.

Not in my case.

@The-Compiler
Copy link
Member Author

Perfect, thanks! It looks like this will be a 1-character fix (plus tests)... 😄

@maxime-michel
Copy link

Thank you!

@The-Compiler The-Compiler added this to the v1.14.1 milestone Nov 20, 2020
The-Compiler added a commit that referenced this issue Nov 24, 2020
See #5663 and #5896 (which we don't test for at the moment)
The-Compiler added a commit that referenced this issue Nov 24, 2020
For easier testability, as a preparation for #5663.
The-Compiler added a commit that referenced this issue Nov 24, 2020
The-Compiler added a commit that referenced this issue Nov 24, 2020
For easier testability, as a preparation for #5663.
The-Compiler added a commit that referenced this issue Nov 24, 2020
The-Compiler added a commit that referenced this issue Nov 24, 2020
For easier testability, as a preparation for #5663.
The-Compiler added a commit that referenced this issue Nov 24, 2020
The-Compiler added a commit that referenced this issue Nov 24, 2020
With macOS Big Sur (11.0), the default monospace font family we get from
QFontDatabase is ".AppleSystemUIFontMonospaced". The leading dot in
there leads to a stylesheet like:

    font: 10pt .AppleSystemUIFontMonospaced;

Which fails to parse, thus messing up styling entirely on Big Sur.

Fixes #5663

(cherry picked from commit 56b1d21)
@The-Compiler
Copy link
Member Author

PyQt 5.15.2 was released today, and I built a preliminary dmg with the latest v1.14.x branch of qutebrowser: https://t.cmpl.cc/qutebrowser-1.14.1-pre.dmg - it should fix both the styling issues (with the default font) and the hangs, could someone confirm?

@donaldguy
Copy link

donaldguy commented Nov 24, 2020

.app Looks good to me!

Also to whom it may concern (if you have other reasons to live the virtualenv life), I opened a bump PR to qt 5.15.2 for homebrew: Homebrew/homebrew-core#65622

Hopefully there will be bottles (binary packages) for that shortly

@aldorgan
Copy link

aldorgan commented Nov 26, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: ui Issues related to the user interface. os: macOS Issues which only happen on macOS. priority: 1 - middle Issues which should be done at some point, but aren't that important. qt Issues related to the Qt framework.
Projects
None yet
Development

No branches or pull requests

6 participants