Ticket #44851

qt client, changing font hides options dlog

Eröffnet am: 2022-06-18 05:25 Letztes Update: 2022-07-29 05:58

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
3

Details

Seen with 3.0.1 on a Mac - possibly a Mac only bug.

Open the "Set local options" dlg, go to the Font tab. Click on any of the font settings buttons, the "Select font" dlog appears. When you click either "Cancel" or "OK" the "Select font" dlog disappears (correct) but the main window (could be map view, Nations, Cities, Research) comes to the front and hides the "Set local options" dlg (incorrect). Could be related to Ticket #43943.

Ticket-Verlauf (3/17 Historien)

2022-06-18 05:25 Aktualisiert von: ddeanbrown
  • New Ticket "qt client, changing font hides options dlog" created
2022-06-20 18:17 Aktualisiert von: cazfi
Kommentar

Like #43943, I cannot reproduce this at the moment (should try to setup a virtual machine with an environment where these might happen)

Does this happen both when the options have been opened from a main menu button (client launch screen) and when the options are opened through the menus in game?

2022-06-26 01:41 Aktualisiert von: cazfi
Kommentar

There's several things that one could experiment with, but one thing that would be Mac specific is "QFontDialog::DontUseNativeDialog" that is documented as "Use Qt's standard font dialog on the Mac instead of Apple's native font panel." - and as we don't set that "Dont" flag, presumably Mac has its own behavior here.

Making a patch to test with that flag set in a second.

2022-06-26 01:53 Aktualisiert von: cazfi
Kommentar

Reply To cazfi

There's several things that one could experiment with, but one thing that would be Mac specific is "QFontDialog::DontUseNativeDialog" that is documented as "Use Qt's standard font dialog on the Mac instead of Apple's native font panel." - and as we don't set that "Dont" flag, presumably Mac has its own behavior here. Making a patch to test with that flag set in a second.

Attached. It actually makes a difference in my Linux - and I much preferred the native dialog that this disables.

2022-06-26 02:25 Aktualisiert von: ddeanbrown
Kommentar

Tried the patch and it does fix the bug on my Mac. Suggest make it a Mac-only change if you prefer.

2022-06-26 04:10 Aktualisiert von: cazfi
Kommentar

Reply To ddeanbrown

Tried the patch and it does fix the bug on my Mac. Suggest make it a Mac-only change if you prefer.

Thanks for testing. So that's one way to resolve the issue, though I'm a bit worried that all this is just a symptom of deeper problem with the options dialog setup. The other a bit similar option type (opening a further selection dlg etc) - color selection - is very buggy: #44947. I've get a rewrite patch for that coming soon, but I wonder if that dialog works on Mac even with my fixes.

(btw. did you notice new comments on #44906?)

2022-06-26 04:47 Aktualisiert von: ddeanbrown
Kommentar

I have added comments to #44906 and #44947.

2022-06-26 20:36 Aktualisiert von: cazfi
Kommentar

Reply To cazfi

Reply To cazfi

"QFontDialog::DontUseNativeDialog" Making a patch to test with that flag set in a second.

btw. That patch has a side-effect that it makes the dialog header translatable with our gettext system (not relying on Qt's own translation - which we don't have in some environments). That part we should implement anyway.

2022-06-27 07:29 Aktualisiert von: cazfi
Kommentar

Reply To cazfi

btw. That patch has a side-effect that it makes the dialog header translatable with our gettext system (not relying on Qt's own translation - which we don't have in some environments). That part we should implement anyway.

-> #44957. I want that one in already, for the translators to have the new strings to work on. For this ticket I still want to investigate options, and update for the color selection dialog part is needed anyway.

2022-07-16 18:31 Aktualisiert von: cazfi
Kommentar

I wonder if raise() would solve this one too, like it did #43943. Can you test with the attached debug_optdlg_raise.patch ?

2022-07-18 07:37 Aktualisiert von: ddeanbrown
Kommentar

That patch seems to be based on a reworked optiondlg.cpp file that doesn't match what I have as 3.0.2 source - option_dialog::set_font() renamed to option_dialog::select_font(), and the color change code unrecognizable. But I was able to verify that using raise() instead of using the QFontDialog::DontUseNativeDialog flag does fix the font change problem. I was also able to verify that using raise() will fix the similar color change bug.

2022-07-25 10:35 Aktualisiert von: cazfi
Kommentar

Reply To ddeanbrown

That patch seems to be based on a reworked optiondlg.cpp file that doesn't match what I have as 3.0.2 source

Nightly generated tarballs of the current code (of each branch) under https://files.freeciv.org/nightly/

Thanks for testing anyway. I'll make a real patch.

2022-07-25 10:40 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
2022-07-29 05:58 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden