wayland: fix WApplication to reuse existing WWindow with frame
- application.c: wApplicationCreate now tries wWindowFor(main_window) before creating a new frameless WWindow via makeMainWindow. For Wayland native clients where main_window == client_win, this returns the real WWindow with its frame, title, and updated wm_class/instance. - window.c: Disable shared_appicon for Wayland native clients (no client_leader or group_id). The shared_appicon logic replaces main_window with a fake group leader ID, which breaks the wWindowFor lookup and produces a frameless duplicate WWindow. Fixes the kill dialog showing "application" instead of the window title for Wayland clients.
This commit is contained in:
parent
c027f092c0
commit
29550b58cb
|
|
@ -114,10 +114,15 @@ WApplication *wApplicationCreate(WWindow * wwin)
|
|||
wapp->last_workspace = 0;
|
||||
|
||||
wapp->main_window = main_window;
|
||||
wapp->main_window_desc = makeMainWindow(scr, main_window);
|
||||
/* If the main_window is also the client window (Wayland native apps),
|
||||
* reuse the existing WWindow which already has a frame. */
|
||||
wapp->main_window_desc = wWindowFor(main_window);
|
||||
if (!wapp->main_window_desc) {
|
||||
wfree(wapp);
|
||||
return NULL;
|
||||
wapp->main_window_desc = makeMainWindow(scr, main_window);
|
||||
if (!wapp->main_window_desc) {
|
||||
wfree(wapp);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
wapp->main_window_desc->fake_group = wwin->fake_group;
|
||||
|
|
|
|||
|
|
@ -773,6 +773,14 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window)
|
|||
if (wwin->flags.is_dockapp)
|
||||
wwin->client_flags.shared_appicon = 0;
|
||||
|
||||
/* Wayland native clients have no real leader; don't merge them
|
||||
* under a fake shared group which replaces main_window. */
|
||||
if (wwin->client_leader == WM_NATIVE_NONE && wwin->group_id == WM_NATIVE_NONE) {
|
||||
wwin->client_flags.shared_appicon = 0;
|
||||
wwin->user_flags.shared_appicon = 0;
|
||||
wwin->defined_user_flags.shared_appicon = 0;
|
||||
}
|
||||
|
||||
if (wwin->main_window) {
|
||||
WApplication *app = wApplicationOf(wwin->main_window);
|
||||
if (app && app->app_icon)
|
||||
|
|
|
|||
Loading…
Reference in New Issue