void QWaylandShellSurface::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial) { QWaylandWindow *parent_wayland_window = parent; if (!parent_wayland_window) return; // set_popup expects a position relative to the parent QPoint transientPos = m_window->geometry().topLeft(); // this is absolute transientPos -= parent_wayland_window->geometry().topLeft(); if (parent_wayland_window->decoration()) { transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left()); transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top()); } set_popup(device->wl_seat(), serial, parent_wayland_window->object(), transientPos.x(), transientPos.y(), 0); }
s8 wl_shell_surface_req(struct client *c,s32 shell_surface_slot,struct msg *m) { s8 r; switch(m->req_op){ case WL_SHELL_SURFACE_PONG: r=pong(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_MOVE: r=move(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_RESIZE: r=resize(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_TOP_LEVEL: LOG_WIRE("client(%d):shell_surface::set_top_level shell_surface_id=%u\n", c->so,m->req[0]); r=shell_surface_set_top_level(c,shell_surface_slot); break; case WL_SHELL_SURFACE_SET_TRANSIENT: r=set_transient(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_FULLSCREEN: r=set_fullscreen(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_POPUP: r=set_popup(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_MAXIMISED: r=set_maximised(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_TITLE: r=set_title(c,shell_surface_slot,m); break; case WL_SHELL_SURFACE_SET_CLASS: r=set_class(c,shell_surface_slot,m); break; default: PERR("client(%d):fatal:shell surface unknown opcode %u\n",c->so,m->req_op); r=LWL_ERR; }; return r; }
void show_popup(char popup[]){ window_stack_push(popup_window, true); set_popup(popup); }