OpenBoard-org / OpenBoard

OpenBoard is a cross-platform interactive whiteboard application intended for use in a classroom setting.
https://openboard.ch/
GNU General Public License v3.0
2.42k stars 435 forks source link

[Bug] < input type="color" > black dialog issue in board, works fine in Web mode #904

Open sebojolais opened 9 months ago

sebojolais commented 9 months ago

Describe the bug

A widget with an < input type="color" > (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color) shows a dialog with only black foreground.

To Reproduce

Context

Additional context

letsfindaway commented 9 months ago

An additional difference between browser mode and widget is on my dual monitor setup that the black color chooser popup appears on the wrong screen, while it is in the middle of the correct screen in web mode.

Technically the difference between these two modes is that the widgets on the board are not part of Qt's widget hierarchy, but wrapped in a QGraphicsProxyWidget which is again a QGraphicsItem on a QGraphicsScene. We already had some strange things caused by that, i.e. that drop down menus appeared on wrong places.

The following screenshot covering two scresns shows some interesting things (click on image to enlarge):

grafik

grafik

I see the rendered color picker, obviously injected by gammaray, but only on the part which is on the right monitor.

This is still a collection of strange things. Does somebody have a good idea?

Jouski commented 9 months ago

I don't know it that helps, but with Openboard 1.7 on Xubuntu 20.04 no problem. Neither on Linux Mint 21.

The color dialog box does'nt look like QT, more GTK/ It's the same displayed in Firefox.

2024-02-27_18-50

sebojolais commented 9 months ago

No more idea if it is helpful

sebojolais commented 9 months ago

For a comparaison with the setup of @Jouski where there is no issue:

In comparaison, when it works as expected, @Jouski sees the same color dialog like in Firefox. But it is contradictory with the documentation where the dialog should come form Qt anyway:

In widget-based applications, the standard dialogs are based on QDialog

Even if there no solution, I hope this message provides more clues.

letsfindaway commented 9 months ago

More observations:

What about users of Windows or MacOS? I could imagine that it is a Linux only problem.

@Jouski Do you have any environment variable set which could affect the color dialog? It is really interesting that you get the dialog we have on Firefox, but not the Qt dialog. If there is such a variable then this could be a mitigation to this problem.

kaamui commented 9 months ago

On Ubuntu 20.04 with Gnome, no issue. On Windows, no issue on the internal navigator, but a similar issue in a widget. The color picker seems unattached to the widget (you can move it anywhere on OpenBoard), neither to OpenBoard (appears as a separate window). It appears white but renders in the thumbnail, and after you click anywhere on OpenBoard it renders, but with the glitches you describe. The color picker remains functional.

image

sebojolais commented 9 months ago

After long time on the Qt issue tracker, I found no trace of this kind of issue. I can imagine 2 causes:

letsfindaway commented 9 months ago

After long time on the Qt issue tracker, I found no trace of this kind of issue. I can imagine 2 causes:

  • It is normal because few projects are using QWebEngine inside a QGraphicsScene...
  • The problem comes from the specific implementation of OB. In this case, a minimal application that reproduce the issue should be helpful.

I just tried it in my minimal example I used elsewhere in a Qt bug report: it is reproducible with a few lines. I will post the minimal example later today.

This means the problem is not specific to OpenBoard, but is a Qt problem.

sebojolais commented 9 months ago

@letsfindaway Thank you so much !

letsfindaway commented 9 months ago

Here is my minimal example:

MinimalColorPicker.tar.gz

@sebojolais You may use this to create a Qt Bug report for this problem. @kaamui It would be interesting why it works on Ubuntu 20.04. Is this using another Qt version?

sebojolais commented 9 months ago

It seems that the Firefox dialog is displayed when the linux desktop is based on GTK.

@Jouski In order to see difference on your system, @letsfindaway mentioned the env variables. Could you return the output of printenv | less please ? It seems that you have XFCE desktop when you see the firefox dialog. Could you confirm that?

Mine is KDE desktop and @kaamui is a GTK one. I heard about an other person under Mate and he sees the firefox dialog also.

@letsfindaway What is your linux desktop ?

I am writing the bug report, thank you for your help.

letsfindaway commented 9 months ago

It seems that the Firefox dialog is displayed when the linux desktop is based on GTK.

This actually seems to be the GTK dialog: https://docs.gtk.org/gtk4/class.ColorChooserDialog.html

Mine is KDE desktop and @kaamui is a GTK one. I heard about an other person under Mate and he sees the firefox dialog also.

@letsfindaway What is your linux desktop ?

My desktop is KDE. But it is interesting that the problem also occurs on Windows. Do we have any indications for MacOS?

I am writing the bug report, thank you for your help.

Thanks! Please post the bug number here when you're done.

letsfindaway commented 9 months ago

@Jouski In order to see difference on your system, @letsfindaway mentioned the env variables. Could you return the output of printenv | less please ? It seems that you have XFCE desktop when you see the firefox dialog. Could you confirm that?

I was searching for any environment variables affecting this and found:

QT_QPA_PLATFORMTHEME=gtk3

If I set this variable, then I get the GTK dialog and the problem is gone! This may be a valid workaround for Linux, but it still cannot mitigate the problem for Windows, I assume.

letsfindaway commented 9 months ago

QT_QPA_PLATFORMTHEME=gtk3

... however here I have the problem that starting from the second invocation of the color picker it no longer appears on the top, but behind the OpenBoard pane and is therefore very difficult to use. :-(

Jouski commented 9 months ago

@Jouski In order to see difference on your system, @letsfindaway mentioned the env variables. Could you return the output of printenv | less please ? It seems that you have XFCE desktop when you see the firefox dialog. Could you confirm that?

Yes I have XFCE desktop. See below the answer of printenv | less :

DESKTOP_SESSION=xubuntu
SSH_AGENT_PID=3003
GTK_MODULES=gail:atk-bridge
XDG_SEAT=seat0
PWD=/home/arnaud
LOGNAME=arnaud
XDG_SESSION_DESKTOP=xubuntu
QT_QPA_PLATFORMTHEME=gtk2
XDG_SESSION_TYPE=x11
PANEL_GDK_CORE_DEVICE_EVENTS=0
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XAUTHORITY=/home/arnaud/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/arnaud
GDM_LANG=fr_FR
HOME=/home/arnaud
LANG=fr_FR.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=30;41: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:*.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:*.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:
XDG_CURRENT_DESKTOP=XFCE
VTE_VERSION=6003
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
GTK_OVERLAY_SCROLLING=0
DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
LESSOPEN=| /usr/bin/lesspipe %s
USER=arnaud
DISPLAY=:0.0
SHLVL=0
XDG_VTNR=7
XDG_SESSION_ID=c1
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/xfce4:/usr/share/xubuntu:/home/arnaud/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/usr/share
PATH=/home/arnaud/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GDMSESSION=xubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
_=/usr/bin/printenv
(END)
sebojolais commented 9 months ago

Thank you guys for your feedbacks. Here it is : https://bugreports.qt.io/browse/QTBUG-122942