Implement Fl_Window::xclass(const char*) for the Wayland platform (#1391).
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

This commit is contained in:
ManoloFLTK
2026-04-04 08:55:08 +02:00
parent 09aafc7b52
commit 158343f66a
2 changed files with 7 additions and 3 deletions
+5 -2
View File
@@ -241,9 +241,12 @@ void Fl_Window::default_xclass(const char *xc)
and the second one if the first is 'x'. Thus "foo" turns into "foo, Foo",
and "xprog.1" turns into "xprog, XProg".
<I>Under Wayland</I>, this is used to set the "application identifier" of toplevel,
bordered windows. If not set, the executable name is used.
<I>Under Microsoft Windows</I>, this string is used as the name of the
WNDCLASS structure, though it is not clear if this can have any
visible effect.
WNDCLASS structure. The user should avoid names that may collide with
system-reserved window class names (e.g., anything beginning with "edit").
\since FLTK 1.3 the passed string is copied. You can use a local
variable or free the string immediately after this call. Note that
@@ -1458,7 +1458,8 @@ void Fl_Wayland_Window_Driver::makeWindow()
new_window->frame = libdecor_decorate(scr_driver->libdecor_context, new_window->wl_surface,
&libdecor_frame_iface, new_window);
// appears in the Gnome desktop menu bar
libdecor_frame_set_app_id(new_window->frame, get_prog_name());
const char *appid = pWindow->xclass() ? pWindow->xclass() : get_prog_name();
libdecor_frame_set_app_id(new_window->frame, appid);
libdecor_frame_set_title(new_window->frame, pWindow->label()?pWindow->label():"");
if (!is_resizable()) {
libdecor_frame_unset_capabilities(new_window->frame, LIBDECOR_ACTION_RESIZE);