Bug 157708 - assign a CSS class or id to the GTK Main Window so custom themes can handle LibreOffice separately
Summary: assign a CSS class or id to the GTK Main Window so custom themes can handle L...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.5.6.2 release
Hardware: All Linux (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: GTK3 UI-Theming
  Show dependency treegraph
 
Reported: 2023-10-11 17:01 UTC by code
Modified: 2023-10-26 13:24 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
gtk inspector with libreoffice (70.07 KB, image/png)
2023-10-11 17:02 UTC, code
Details

Note You need to log in before you can comment on or make changes to this bug.
Description code 2023-10-11 17:01:51 UTC
Description:
Could you add a CSS class or an id to the main window of LibreOffice?
For example id=LibreOfficeMainWindow like Geany do.

This is to update a GTK theme to add some CSS styles, but only for LibreOffice (extra: another id/class to the grid element that contains the menubar). 

Steps to Reproduce:
1. Install lib gtk 3 dev
2. Run LibreOffice with the following command line: `GTK_DEBUG=interactive libreoffice`
3. With the inspector, go to the main window

Actual Results:
There is no way to identify the libreoffice window.

Expected Results:
A way to identify the libreoffice window.
For example: id=LibreOfficeMainWindow


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.5.6.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 32; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Debian package version: 4:7.5.6-1
Calc: threaded
Comment 1 code 2023-10-11 17:02:18 UTC
Created attachment 190151 [details]
gtk inspector with libreoffice
Comment 2 Stéphane Guillou (stragu) 2023-10-25 21:19:55 UTC
Thanks for the suggestion.
I expanded the summary, does that describe your use case correctly?

Michael, Caolán and Heiko, I feel like you all could have an opinion on this?
If not, please feel free to un-CC :)
Admittedly, not a high priority enhancement, but I guess it can't hurt and could be quite easy to fix?
Comment 3 Michael Weghorn 2023-10-26 05:52:34 UTC
(In reply to Stéphane Guillou (stragu) from comment #2)
> Michael, Caolán and Heiko, I feel like you all could have an opinion on this?
> If not, please feel free to un-CC :)
> Admittedly, not a high priority enhancement, but I guess it can't hurt and
> could be quite easy to fix?

No objections from my side. Sounds reasonable to me and from a quick glance at the geany source code, that seems to be just a matter of calling 'gtk_widget_set_name' for the corresponding widget:
https://github.com/geany/geany/blob/ba6fc4a4fa48239daca7350ec05d25e44cc89169/src/libmain.c#L294
Comment 4 Heiko Tietze 2023-10-26 07:19:40 UTC
No harm, and apparently not much effort: +1 (ultimately a topic for Caolan)
Comment 5 Caolán McNamara 2023-10-26 09:52:39 UTC
I don't have an objection, presumably safe to do like the others do
Comment 6 Stéphane Guillou (stragu) 2023-10-26 13:24:37 UTC
OK, thank you throth for the fast replies, let's set to "new" for anyone who wants to pick it up.

Hossein, an easyHack?