XDG-Shell:如何更改窗口大小
XDG-Shell: how to change window size?
我将 xdg-shell v5 添加到应用程序中以绘制窗口。当我发送set_fullscreen或set_maximize命令时,我在配置事件中看到正确设置的窗口状态和正确的大小,但没有任何反应。
我的配置事件功能:
static void
xdg_surface_handle_configure(void *data,
struct xdg_surface *xdg_surface,
int32_t width,
int32_t height,
struct wl_array *states,
uint32_t serial) {
printf("Configure event got, width: %d, height: %dn", width, height);
VirtIOGPU *g = (VirtIOGPU*) data;
g->window_state.activated = g->window_state.fullscreen =
g->window_state.maximized = g->window_state.resizing = false;
uint32_t *state;
wl_array_for_each(state, states) {
if(*state == XDG_SURFACE_STATE_MAXIMIZED) {
printf("Surface state: XDG_SURFACE_STATE_MAXIMIZEDn");
g->window_state.maximized = true;
} else if(*state == XDG_SURFACE_STATE_FULLSCREEN) {
printf("Surface state: XDG_SURFACE_STATE_FULLSCREENn");
g->window_state.fullscreen = true;
} else if(*state == XDG_SURFACE_STATE_RESIZING) {
printf("Surface state: XDG_SURFACE_STATE_RESIZINGn");
g->window_state.resizing = true;
} else if(*state == XDG_SURFACE_STATE_ACTIVATED) {
printf("Surface state: XDG_SURFACE_STATE_ACTIVATEDn");
g->window_state.activated = true;
}
}
if (width > 0 && height > 0) {
g->prev_width = g->width;
g->prev_height = g->height;
g->width = width;
g->height = height;
} else {
g->width = g->prev_width;
g->height = g->prev_height;
}
xdg_surface_ack_configure(xdg_surface, serial);
wl_surface_damage(g->surface, 0, 0, g->width, g->height);
wl_surface_commit(g->surface);
wl_display_dispatch_pending(g->display);
wl_display_flush(g->display);
}
那么,发送set_maximized后如何查看最大化的窗口?是否可以以编程方式取消最小化最小化窗口(现在通过 Super+Tab(?
客户端可能需要将具有正确尺寸的新缓冲区附加到图面。合成器已经完成了它应该做的所有事情,并期望你的客户端调整大小。
相关文章:
- SDL2 调整窗口大小后如何缩放鼠标坐标?
- 如何设置与其背景图像大小相对应的窗口大小?
- 如何防止opengl绘图拉伸到窗口大小?
- 使用 Win32 将 GDI 绘制大小缩放为窗口大小
- 恢复Qt窗口大小和位置问题
- 与WM_DPICHANGED消息一起发送的建议窗口大小太大
- 快板获取当前窗口大小
- 当窗口大小更改时,如何自动缩放QT中的图表
- 尝试在 win 32 中禁用窗口大小调整时,窗口样式行为不一致
- OpenGL纹理闪烁/有时在窗口大小上移动
- QGraphics手动调整窗口大小后场景宽度/高度没有变化
- Qt - 防止在拖动标题栏时调整窗口大小
- 在 Direct2D 绘图中,调整窗口大小后尺寸会更改
- 在窗口大小上绘制的OpenGL消失
- XDG-Shell:如何更改窗口大小
- WinAPI.检查窗口大小调整是否已完成
- Win32 透明全屏仅在窗口大小溢出桌面时才有效
- 如何设置启用setFixize后再次调整主窗口大小
- 如何在C++中更改窗口大小
- 更改子窗口大小opengl