Closed Bug 1952756 Opened 10 days ago Closed 7 days ago

Client side decorations offset clickable screen area

Categories

(Core :: Widget: Gtk, defect, P2)

Firefox 137
defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox136 --- unaffected
firefox137 --- fixed
firefox138 --- fixed

People

(Reporter: pqwoerituytrueiwoq, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached video 2025-03-09_12-03-19.mp4

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0

Steps to reproduce:

Use Kubuntu 24.04 using X11
Open firefox with a system theme that has client side decorations (the profile selector is enough to reproduce)

**This does not happen with the stable release 136

note that the firefox 64bit binary is from the tar download on the mozilla website

Actual results:

clickable area is offset

Expected results:

clickable area should not be offset

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Can you use mozregression to find broken commit?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Use_Mozregression_tool
Thanks.

Blocks: gtktitlebar
Flags: needinfo?(pqwoerituytrueiwoq)
Priority: -- → P2

Hmm, You mean with server side decorations right? Or do you need a custom GTK theme or something?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Hmm, You mean with server side decorations right? Or do you need a custom GTK theme or something?

i get that mixed up... the window decorations in KDE 5, Wayland is unaffected

note that the size of the offset changes depending on the decorations selected

Flags: needinfo?(pqwoerituytrueiwoq)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)

Can you use mozregression to find broken commit?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Use_Mozregression_tool
Thanks.

it broke between 2025-03-10 and 2025-03-11, the tab bar is under the window decorations, well that explains where my menu bar went...

here is a screenshot: https://i.imgur.com/Qozf07W.png

the tool is getting stuck trying to download a9fff10e

(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)

Can you use mozregression to find broken commit?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Use_Mozregression_tool
Thanks.

https://i.imgur.com/U9wrnsQ.png

2025-03-12T00:28:06.290000: INFO : Narrowed integration regression window from [dabc3564, 7c1bc15b] (3 builds) to [dabc3564, 321052fb] (2 builds) (~1 steps left)
2025-03-12T00:28:06.877000: DEBUG : Found commit message:
Bug 1940816 - Put newtab chrome and resource assets under chrome://newtab and resource://newtab r=home-newtab-reviewers,omc-reviewers,mconley,credential-management-reviewers,marco,emcminn,valentin,dimi CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D236880
2025-03-12T00:28:07.352000: INFO : ************* Switching to autoland by process of elimination (no branch detected in commit message)

Attached image mozregression.png

Could you finish running it? That screenshot still was downloading more builds, that way we can find a pushlog :)

Flags: needinfo?(pqwoerituytrueiwoq)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)

Could you finish running it? That screenshot still was downloading more builds, that way we can find a pushlog :)

tool frozen, tried more than once it keep freezing/hanging on that download in the same spot every time

Flags: needinfo?(pqwoerituytrueiwoq)

(In reply to pqwoerituytrueiwoq from comment #9)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)

Could you finish running it? That screenshot still was downloading more builds, that way we can find a pushlog :)

tool frozen, tried more than once it keep freezing/hanging on that download in the same spot every time

i figured out why... the partition it was saving to was full...

2025-03-12T10:20:48.801000: DEBUG : Found commit message:
Bug 1946184 - More accurately compute the right CSD offset. r=stransky

For tiled windows GTK does some interesting stuff because they're not
resizable: https://gitlab.gnome.org/GNOME/gtk/-/blob/272570021cba71d39f5d6387a27e559c6c454322/gtk/gtkwindow.c?page=8#L7164

Fix the reason of the more reliable CSD offsets not working (the fact
that we could get multiple size allocates for the same change and we
won't schedule bounds updates for those).

Differential Revision: https://phabricator.services.mozilla.com/D236964

2025-03-12T10:20:48.801000: DEBUG : Did not find a branch, checking all integration branches
2025-03-12T10:20:48.803000: INFO : The bisection is done.
2025-03-12T10:20:48.804000: INFO : Stopped

Thanks, that does seem more plausible, but I'm still at a loss at how to reproduce it. Do you have any custom Kwin / plasma settings that could be related? Locally with plasma x11 and xwayland I can't repro whatsoever.

Keywords: regression
Regressed by: 1946184

does this help? i do not think i am doing anything fancy, just using the breeze theme, note that i am not able to reproduce this on wayland, this is specific to X11

Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.13.0-rc5 (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 5600 XT
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B79
System Version: 2.0

this is from screenfetch:
GTK Theme: Breeze [GTK2/3]
WM: KWin
DE: KDE 5.115.0 / Plasma 5.27.12
Icon Theme: breeze-dark

i'll check a different system user profile in little bit later, but for the most part my kde theme setting are fairly stock

found some interesting things out, i can reproduce it on my clean testing profile, i am unable to on a live cd of 24.04.2/22.04.5

however i noticed a difference aside from the issue, when this bug is triggered you do not get the option to enable/disable the titlebar, this is likely related to this

possibly related to this

$ apt-cache policy gtk3-nocsd libgtk3-nocsd0
gtk3-nocsd:
Installed: 3-1ubuntu3
Candidate: 3-1ubuntu3
Version table:
*** 3-1ubuntu3 500
500 http://us.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu noble/universe i386 Packages
100 /var/lib/dpkg/status
libgtk3-nocsd0:
Installed: 3-1ubuntu3
Candidate: 3-1ubuntu3
Version table:
*** 3-1ubuntu3 500
500 http://us.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
100 /var/lib/dpkg/status

Thanks! Indeed, I can repro with LD_PRELOAD="/usr/lib/libgtk3-nocsd.so.0" GTK_CSD=0 ./firefox/firefox -P

Use our internal state to determine whether we know we're undecorated,
since gtk3 with gtk3-nocsd hooked in will misreport it.

This does really suck, that said.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Comment on attachment 9471496 [details]
Bug 1952756 - Workaround gtk3-nocsd. r=stransky

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Works around a hacky library that gets used in some common configurations including Kubuntu.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Check kubuntu, or ubuntu with gtk3-nocsd installed.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): One-liner that uses our internal state rather than GTK's. Linux-only
  • String changes made/needed: none
  • Is Android affected?: No
Attachment #9471496 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Set release status flags based on info from the regressing bug 1946184

Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
QA Whiteboard: [qa-triaged]
Attachment #9471496 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I set up a Kubuntu 24.04 machine in VM and I set everything I saw in this bug:

  • breeze-dark, x11, gtk3-nocsd installed,
  • libgtk3-nocsd.so.0 and libgtk3-nocsd0:i386 (i saw in a ubuntu forum thread that installing this might solve the error explained a bit lower)
  • I am getting lots of Error: ld.so: object '/usr/lib/libgtk3-nocsd.so.0' from LD PRELOAD cannot be preloaded (cannot open shared object file): ignored. messages when starting DevEdition 137.0b4 with the command from comment 16
  • I then wrote in .bashrc the following line "export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0" (possible solution found online for the error but again it did not do much)

Firefox does start though even if I get the error from above so here are my findings:

  • I still can't see the offset in the profile manager prompt as in comment 0, though the title bar selector is missing from Customize, but I noticed that it will be active (as if selected)
  • Starting the DevEd without the command from comment 16 again will display no issue in the profile manager prompt and the Title bar is perfectly visible and usable in Customize.

I am not sure if I'm missing something or not. Any ideas?

Flags: needinfo?(emilio)

$ locate libgtk3-nocsd.so.0
/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0
$ echo $LD_PRELOAD
libgtk3-nocsd.so.0
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

did you try logging out and in of the desktop session after installing gtk3-nocsd

the only message i get in the cli when running firefox -P is this (137b4):
ATTENTION: default value of option mesa_glthread overridden by environment.

since you are using a VM do you have any gpu acceleration for desktop effects? that may be required, did my test on a live usb on bare metal

Right, you need to find the right location of gtk3-nocsd, so maybe something like:

LD_PRELOAD=$(locate libgtk3-nocsd.so.0) GTK_CSD=0 /path/to/firefox
Flags: needinfo?(emilio)

on my install, the '/path/to/' libgtk3-nocsd.so.0 is not needed
if you notice on my system LD_PRELOAD="libgtk3-nocsd.so.0" there is no path, if i run LD_PRELOAD="" /path/to/firefox the issues is not reproducible as libgtk3-nocsd is not loaded into firefox, on that note it seems possible firefox could check is this lib is going to be loaded and skip doing so, then setting the config option to respect the intent of the lib, maybe that would be a more less dirty way to solve the issue? frankly libgtk3-nocsd is a dirty hack in the 1st place so a dirty workaround for it is likely to be dirty anyway

if you are wondering GTK_CSD=0 on my system

You can avoid /path/to if you have that path in your LD_LIBRARY_PATH, but I wanted to avoid it :)

i do not have a LD_LIBRARY_PATH set o.O

$ printenv | sed "s/$USER/\$USER/g"
SHELL=/bin/bash
SESSION_MANAGER=local/X470-Gaming-Plus:@/tmp/.ICE-unix/2179,unix/X470-Gaming-Plus:/tmp/.ICE-unix/2179
WINDOWID=88080397
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/home/$USER/.config/kdedefaults:/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
ICEAUTHORITY=/run/user/1000/iceauth_RCrKSx
LANGUAGE=
SSH_AUTH_SOCK=/tmp/ssh-jAiEPVuVJIHi/agent.1926
SHELL_SESSION_ID=8f27416c9dca4d5d848060f8d007ebab
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
DESKTOP_SESSION=plasma
SSH_AGENT_PID=2049
GTK_RC_FILES=/etc/gtk/gtkrc:/home/$USER/.gtkrc:/home/$USER/.config/gtkrc
XCURSOR_SIZE=24
XDG_SEAT=seat0
PWD=/home/$USER
XDG_SESSION_DESKTOP=KDE
LOGNAME=$USER
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
SYSTEMD_EXEC_PID=2244
XAUTHORITY=/tmp/xauth_BrjaoI
LD_PRELOAD=libgtk3-nocsd.so.0
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/$USER/.gtkrc-2.0:/home/$USER/.config/gtkrc-2.0
HOME=/home/$USER
IM_CONFIG_PHASE=1
SSH_ASKPASS=/usr/bin/ksshaskpass
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
XDG_CURRENT_DESKTOP=KDE
KONSOLE_DBUS_SERVICE=:1.59616
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/plasma-plasmashell.service/memory.pressure
KONSOLE_DBUS_SESSION=/Sessions/1
PROFILEHOME=
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
QTWEBENGINE_DICTIONARIES_PATH=/usr/share/hunspell-bdic/
INVOCATION_ID=61e4434cc75a4b4eb344eabfedd51eac
KONSOLE_VERSION=230805
MANAGERPID=1888
GTK_CSD=0
KDE_SESSION_UID=1000
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LESSOPEN=| /usr/bin/lesspipe %s
LIBVIRT_DEFAULT_URI=qemu:///system
USER=$USER
COLORFGBG=15;0
KDE_SESSION_VERSION=5
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
DISPLAY=:0
SHLVL=1
GSM_SKIP_SSH_AGENT_WORKAROUND=true
XDG_VTNR=2
XDG_SESSION_ID=3
XDG_RUNTIME_DIR=/run/user/1000
DEBUGINFOD_URLS=https://debuginfod.ubuntu.com 
QT_AUTO_SCREEN_SCALE_FACTOR=0
JOURNAL_STREAM=9:16759
XCURSOR_THEME=cz-Viator (Black)
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share/:/usr/share/
KDE_FULL_SESSION=true
PATH=/home/$USER/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
KDE_APPLICATIONS_AS_SCOPE=1
KONSOLE_DBUS_WINDOW=/Windows/1
_=/usr/bin/printenv

(In reply to pqwoerituytrueiwoq from comment #24)

did you try logging out and in of the desktop session after installing gtk3-nocsd

Yeah, also restarted the OS a few times as well.

since you are using a VM do you have any gpu acceleration for desktop effects? that may be required, did my test on a live usb on bare metal

Not sure how to check that, the VM was freshly made just for this bug in particular though.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #25)

Right, you need to find the right location of gtk3-nocsd, so maybe something like:

LD_PRELOAD=$(locate libgtk3-nocsd.so.0) GTK_CSD=0 /path/to/firefox

I did have libgtk3-nocsd.so.0 in this location /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0. The command from Emilio helped getting rid of the launch error but I still can't see the offset in the profile dialogue.
@pqwoerituytrueiwoq do you mind if you check if this is fixed for you on two Firefox builds so we can close this bug?

Flags: needinfo?(pqwoerituytrueiwoq)

using both of those builds the profile selector is unaffected, there is 0 vertical offset down to the pixel (checked both with and without libgtk3-nocsd.so.0)

as for gpu acceleration
assuming you are using virtualbox, VM settings -> Display -> Screen tab (default tab under display)
max video memory and check the enable 3d acceleration at the bottom

Flags: needinfo?(pqwoerituytrueiwoq)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: