fix WPrefs window decorations: only skip wManageWindow when a real WINGs dialog frame buffer is found (id>=0x20000000); regular WINGs windows (app_id="WINGs") now go through normal frame creation
This commit is contained in:
parent
fb95ffc450
commit
01c2664b2f
|
|
@ -228,16 +228,15 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
|
|||
view->xdg_surface->toplevel->app_id ? view->xdg_surface->toplevel->app_id : "(none)",
|
||||
view->xdg_surface->toplevel->title ? view->xdg_surface->toplevel->title : "(none)");
|
||||
|
||||
/* Detect WINGs dialogs: these are rendered by WINGs into an XDG
|
||||
* toplevel but managed through a fake_leader (not as their own WM
|
||||
* window). Skip wManageWindow and connect directly to the frame. */
|
||||
/* WINGs/Wayland sets app_id="WINGs" for ALL windows (wclient_wl.c),
|
||||
* not just dialogs. Only treat as "WINGs dialog" when we actually
|
||||
* find a pre-created frame buffer from wl_client_reparent. Regular
|
||||
* WINGs windows (WPrefs) must go through wManageWindow. */
|
||||
const char *app_id_check = view->xdg_surface->toplevel->app_id;
|
||||
int is_wings_dialog = (app_id_check && strcmp(app_id_check, "WINGs") == 0);
|
||||
int is_wings_dialog = 0;
|
||||
int is_popup = (app_id_check && strcmp(app_id_check, "wings-popup") == 0);
|
||||
|
||||
/* For WINGs dialogs, find the frame buffer created by wl_client_reparent
|
||||
* and adopt its ID so view_surface_at returns a WINGs-recognized ID. */
|
||||
if (is_wings_dialog) {
|
||||
if (app_id_check && strcmp(app_id_check, "WINGs") == 0) {
|
||||
struct wl_frame_buf *_fb;
|
||||
wl_list_for_each(_fb, &wl_state.frame_list, link) {
|
||||
if (_fb->id >= 0x20000000 && !wl_find_view_by_id(_fb->id)) {
|
||||
|
|
@ -246,6 +245,7 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
|
|||
view->frame_id = _fb->parent_id;
|
||||
view->frame_rel_x = _fb->rel_x;
|
||||
view->frame_rel_y = _fb->rel_y;
|
||||
is_wings_dialog = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue