mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-10 03:25:50 +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
@@ -410,3 +410,33 @@ WMPoint wGetPointToCenterRectInHead(WScreen * scr, int head, int width, int heig
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Find the bounding rect of the union of two rectangles */
|
||||
void wGetRectUnion(const WMRect *rect1, const WMRect *rect2, WMRect *dest)
|
||||
{
|
||||
int dest_x, dest_y;
|
||||
int dest_w, dest_h;
|
||||
|
||||
dest_x = rect1->pos.x;
|
||||
dest_y = rect1->pos.y;
|
||||
dest_w = rect1->size.width;
|
||||
dest_h = rect1->size.height;
|
||||
|
||||
if (rect2->pos.x < dest_x) {
|
||||
dest_w += dest_x - rect2->pos.x;
|
||||
dest_x = rect2->pos.x;
|
||||
}
|
||||
if (rect2->pos.y < dest_y) {
|
||||
dest_h += dest_y - rect2->pos.y;
|
||||
dest_y = rect2->pos.y;
|
||||
}
|
||||
if (rect2->pos.x + rect2->size.width > dest_x + dest_w)
|
||||
dest_w = rect2->pos.x + rect2->size.width - dest_x;
|
||||
if (rect2->pos.y + rect2->size.height > dest_y + dest_h)
|
||||
dest_h = rect2->pos.y + rect2->size.height - dest_y;
|
||||
|
||||
dest->pos.x = dest_x;
|
||||
dest->pos.y = dest_y;
|
||||
dest->size.width = dest_w;
|
||||
dest->size.height = dest_h;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user