Bug 166811 - On Windows, tree view elements with undetermined state ("on demand") have non-native expand icons
Summary: On Windows, tree view elements with undetermined state ("on demand") have non...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.5
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-01 08:23 UTC by Mike Kaganski
Modified: 2025-06-09 09:18 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
APSO dialog showing the issue (69.26 KB, image/png)
2025-06-01 08:23 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-06-01 08:23:32 UTC
Created attachment 201064 [details]
APSO dialog showing the issue

The screenshot has a tree view with all four element states, screenshotted on Windows, GTK3, and gen.

* "InsertHello" is a leaf element, without any "expand"/"collapse" icon.
* "InsertText" is an expanded element, showing the normal "collapse" icon, defined by Windows theme.
* "LibreLogo" is a collapsed element, showing the normal "expand" icon, defined by Windows theme.
* "HelloWorld" is an element, which has "CHILDREN_ON_DEMAND" flag, i.e. "we don't know yet, if there are children of the element, or this is a leaf".

The "HelloWorld" element shows a triangle on Windows, which is "alien" to the other, normal "collapse"/"expand" icons. It is actually drawn by "!bNativeOK" code in SvTreeListBox::PaintEntry1, the fallback used for controls that can't be drawn natively. The triangle shape itself looks similar to GTK or gen icons used for the task.

On gen and GTK, the "CHILDREN_ON_DEMAND" elements are indistinguishable from ordinary collapsed entries. On Windows, TVP_GLYPH has only two states (GLPS_CLOSED, GLPS_OPENED) [1], which shows that it uses the same idea. We should treat "CHILDREN_ON_DEMAND" as ordinary collapsed for the purposes of drawing the icon.

[1] https://learn.microsoft.com/en-us/windows/win32/controls/parts-and-states
Comment 1 Mike Kaganski 2025-06-01 08:45:08 UTC
https://gerrit.libreoffice.org/c/core/+/186106
Comment 2 Mike Kaganski 2025-06-01 09:00:14 UTC
In fact, a "regression" from dad7593cf6bb91ecf95153e983723dd2cd03b469.
Comment 3 Commit Notification 2025-06-01 12:26:50 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/54802cdceb9ff3903b4be1b81638b75fdbfb21f4

tdf#166811: let CHILDREN_ON_DEMAND entries draw collapsed in vcl/win

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-06-09 09:18:50 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/9f8c36837329d75e4818d1c0faa1e864afb73870

tdf#166811: let CHILDREN_ON_DEMAND entries draw collapsed in vcl/win

It will be available in 25.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.