Project

General

Profile

Bug #853130

Qt client configuration can end up with illegal theme "Freeciv", leading to display problems

Added by Jacob Nevins 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
gui-qt
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Sometimes, 2.6.1 Qt client is starting up with bad theming. This seems to be a combination of two problems:
  1. Client rc file somehow ends up with gui_qt_default_theme_name="Freeciv", which is not a valid theme name;
  2. Qt client reacts to this illegal theme name by partially loading UI-theme-related material, leading to bad display.

This may have been exposed or made worse by fixes for #782349 and/or #850290, between 2.6.0 and 2.6.1.

It can be worked around by explicitly setting the theme in the client options. (The illegal theme name is not visible in the UI -- the UI state is indistinguishable from having the default "NightStalker" theme selected -- but re-selecting NightStalker and saving options is sufficient to fix the symptom.)

qt_badtheme_start.png (220 KB) qt_badtheme_start.png 2.6.1 Qt client with "Freeciv" in rc file: start screen Jacob Nevins, 2019-12-19 01:17 AM
qt_badtheme_main.png (202 KB) qt_badtheme_main.png 2.6.1 Qt client with "Freeciv" in rc file: main game screen Jacob Nevins, 2019-12-19 01:18 AM
qt_badtheme_config.png (31.4 KB) qt_badtheme_config.png 2.6.1 Qt client with "Freeciv" in rc file: client options UI Jacob Nevins, 2019-12-19 01:18 AM
qt_goodtheme_start.png (337 KB) qt_goodtheme_start.png 2.6.1 Qt client with "NightStalker" in rc file: start screen Jacob Nevins, 2019-12-19 01:18 AM
qt_goodtheme_main.png (226 KB) qt_goodtheme_main.png 2.6.1 Qt client with "NightStalker" in rc file: main game screen Jacob Nevins, 2019-12-19 01:19 AM
qt_goodtheme_config.png (33.7 KB) qt_goodtheme_config.png 2.6.1 Qt client with "NightStalke" in rc file: client options UI Jacob Nevins, 2019-12-19 01:19 AM
0010-Qt-Fallback-to-FC_QT_DEFAULT_THEME_NAME.patch (1.42 KB) 0010-Qt-Fallback-to-FC_QT_DEFAULT_THEME_NAME.patch Marko Lindqvist, 2019-12-19 02:08 AM
0010-Qt-Fallback-to-FC_QT_DEFAULT_THEME_NAME.patch (1.16 KB) 0010-Qt-Fallback-to-FC_QT_DEFAULT_THEME_NAME.patch Marko Lindqvist, 2019-12-19 03:48 AM

Related issues

Related to Freeciv - Bug #782349: Qt-client: assertion '((void *)0) != theme_name && theme_name[0] != '\0'' failed.Closed

Related to Freeciv - Bug #850290: Qt client will only load new themes from the same directory as its startup themeClosed

Related to Freeciv - Bug #853140: qtg_gui_clear_theme() doesn't fallback all the way to FC_QT_DEFAULT_THEME_NAMEClosed

Blocks Freeciv - Task #853141: Release 2.6.2Closed2020-02-152020-02-15

History

#1 Updated by Jacob Nevins 7 months ago

Observations of the symptom, point 2:

The attached screenshots compare what happens when gui_qt_default_theme_name="Freeciv" ("badtheme") and gui_qt_default_theme_name="NightStalker" ("goodtheme"). Things that go wrong include:
  • No theming on start screen
  • In main game screen:
    • Buttons on left go mostly white when you hover over them
    • Chat window has white background instead of black
  • White-on-light-grey text in some window titles

#2 Updated by Jacob Nevins 7 months ago

How we end up with the invalid theme name in config, point 1:

I think it is due to migration of settings from 2.5. Somehow, I ended up with gui_qt_default_theme_name="Freeciv" in my .freeciv-client-rc-2.5; I think this was migrated to .freeciv/freeciv-client-rc-2.6 where it is now causing trouble. Some players will have a similar history, others may not.

I don't know how this happened, though; I think 2.5's Qt always defaulted to a theme called "Fusion". I don't think the theme name "Freeciv" has ever been used for Qt (unlike the other GUIs).

A few people have seen this symptom, and I don't know their settings migration history, but mine is relatively controlled: I started out with a clean slate, started 2.5 client(s) and saved their default options (from late on S2_5, I think), then started 2.6 clients which migrated their options from the 2.5 rc-file.

#3 Updated by Jacob Nevins 7 months ago

  • Related to Bug #782349: Qt-client: assertion '((void *)0) != theme_name && theme_name[0] != '\0'' failed. added

#4 Updated by Jacob Nevins 7 months ago

  • Related to Bug #850290: Qt client will only load new themes from the same directory as its startup theme added

#5 Updated by Marko Lindqvist 7 months ago

While I don't get those exact symptoms (I guess it depends on what the defaults in the system happen to be), UI think it's any (or at least many) theme names derived from 2.5.
By creating fresh 2.5 client settings file I got "Default", and that migrated to 2.6 still as "Default", and I don't think S2_6 has any handling for such a theme name (it should, but that's another matter). Similarly if one sets theme "Fusion" in 2.5, it gets verbatim to 2.6 and is not supported.

#6 Updated by Marko Lindqvist 7 months ago

Does this patch (S2_6 version) help?

#7 Updated by Marko Lindqvist 7 months ago

Marko Lindqvist wrote:

Does this patch (S2_6 version) help?

It's not commit candidate. Instead Bug #853140 should be fixed first, and then this fix should be adjusted accordingly.

#8 Updated by Marko Lindqvist 7 months ago

  • Related to Bug #853140: qtg_gui_clear_theme() doesn't fallback all the way to FC_QT_DEFAULT_THEME_NAME added

#9 Updated by Marko Lindqvist 7 months ago

Patch that depends on Bug #853140, for all branches.

#10 Updated by Marko Lindqvist 7 months ago

#11 Updated by Marko Lindqvist 7 months ago

It was Bug #782349, by the way.

Earlier qtg_gui_load_theme() was called directly and if it failed to find the theme, it called qtg_gui_clear_theme() for setting default theme.

After the change load_theme() is being called, and it doesn't even call qtg_gui_load_theme() unless it knows that there is a theme (and where it is).

#12 Updated by Marko Lindqvist 7 months ago

So is the proposed patch considered

a) Completely wrong - do not commit
b) Sufficient temporary solution - commit for now, leave ticket open for a proper fix
c) Sufficient solution - commit & close ticket

#13 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF