mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
Add support for _NET_WM_FULLSCREEN_MONITORS
This patch adds the _NET_WM_FULLSCREEN_MONITORS hint as defined in EWMH which is based on Xinerama. It's allowing a window to be displayed fullscreen on multiple monitors. Issue mentioned at https://github.com/window-maker/wmaker/issues/8 Specs at https://specifications.freedesktop.org/wm-spec/1.5/ar01s06.html#idm45763309187776 GTK test program used https://bugzilla.gnome.org/show_bug.cgi?id=414476
This commit is contained in:
committed by
Carlos R. Mafra
parent
ac75047aef
commit
4d658341d2
@@ -912,6 +912,54 @@ void wUnmaximizeWindow(WWindow *wwin)
|
||||
WMPostNotificationName(WMNChangedState, wwin, "maximize");
|
||||
}
|
||||
|
||||
#ifdef USE_XINERAMA
|
||||
void wFullscreenMonitorsWindow(WWindow *wwin, unsigned long top, unsigned long bottom,
|
||||
unsigned long left, unsigned long right)
|
||||
{
|
||||
int i;
|
||||
long monitor;
|
||||
WMRect rect1, rect2;
|
||||
|
||||
if ((int)top < wwin->screen_ptr->xine_info.count &&
|
||||
(int)bottom < wwin->screen_ptr->xine_info.count &&
|
||||
(int)left < wwin->screen_ptr->xine_info.count &&
|
||||
(int)right < wwin->screen_ptr->xine_info.count) {
|
||||
wwin->flags.fullscreen_monitors[0] = top;
|
||||
wwin->flags.fullscreen_monitors[1] = bottom;
|
||||
wwin->flags.fullscreen_monitors[2] = left;
|
||||
wwin->flags.fullscreen_monitors[3] = right;
|
||||
} else {
|
||||
wwin->flags.fullscreen_monitors[0] = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
wwin->flags.fullscreen = True;
|
||||
wWindowConfigureBorders(wwin);
|
||||
ChangeStackingLevel(wwin->frame->core, WMFullscreenLevel);
|
||||
|
||||
wwin->bfs_geometry.x = wwin->frame_x;
|
||||
wwin->bfs_geometry.y = wwin->frame_y;
|
||||
wwin->bfs_geometry.width = wwin->frame->core->width;
|
||||
wwin->bfs_geometry.height = wwin->frame->core->height;
|
||||
|
||||
i = 0;
|
||||
monitor = wwin->flags.fullscreen_monitors[i];
|
||||
rect1 = wwin->screen_ptr->xine_info.screens[monitor];
|
||||
|
||||
for (i = 1; i <= 3; i++) {
|
||||
monitor = wwin->flags.fullscreen_monitors[i];
|
||||
rect2 = wwin->screen_ptr->xine_info.screens[monitor];
|
||||
wGetRectUnion(&rect1, &rect2, &rect1);
|
||||
}
|
||||
wWindowConfigure(wwin, rect1.pos.x, rect1.pos.y, rect1.size.width, rect1.size.height);
|
||||
|
||||
wwin->screen_ptr->bfs_focused_window = wwin->screen_ptr->focused_window;
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
|
||||
WMPostNotificationName(WMNChangedState, wwin, "fullscreen");
|
||||
}
|
||||
#endif
|
||||
|
||||
void wFullscreenWindow(WWindow *wwin)
|
||||
{
|
||||
int head;
|
||||
|
||||
Reference in New Issue
Block a user