This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository e16.
View the commit online.
commit 214222e100e2be24abd85e8a006f58544b998078
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sun Oct 15 15:22:31 2023 +0200
desktops: Maintain separate workareas for each desktop
---
src/desktops.c | 10 ++++++++++
src/desktops.h | 1 +
src/etypes.h | 9 ++++++++-
src/ewmh.c | 22 ++++++++++------------
4 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/src/desktops.c b/src/desktops.c
index 9ec56ae6..66ea567a 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -447,6 +447,11 @@ _DeskCreate(int desk, int configure)
HintsSetRootInfo(EoGetWin(dsk), NoXID, 0);
}
+ dsk->workarea.x = 0;
+ dsk->workarea.y = 0;
+ dsk->workarea.w = EoGetW(dsk);
+ dsk->workarea.h = EoGetH(dsk);
+
#if USE_BG_WIN_ON_ALL_DESKS /* TBD - Use per virtual root bg window? */
#if USE_COMPOSITE
/* Add background window */
@@ -749,6 +754,11 @@ _DeskResize(int desk, int w, int h)
_DeskControlsDestroy(dsk, 1);
_DeskControlsCreate(dsk);
_DeskControlsShow(dsk, 1);
+
+ dsk->workarea.x = 0;
+ dsk->workarea.y = 0;
+ dsk->workarea.w = w;
+ dsk->workarea.h = h;
}
Desk *
diff --git a/src/desktops.h b/src/desktops.h
index cd344de1..54e615ad 100644
--- a/src/desktops.h
+++ b/src/desktops.h
@@ -43,6 +43,7 @@ struct _desk {
Button *tag;
int current_area_x;
int current_area_y;
+ Area workarea;
struct {
Background *bg;
EObj *o;
diff --git a/src/etypes.h b/src/etypes.h
index e030e0f4..19acca78 100644
--- a/src/etypes.h
+++ b/src/etypes.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
- * Copyright (C) 2004-2009 Kim Woelders
+ * Copyright (C) 2004-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -57,4 +57,11 @@ typedef struct _timer Timer;
typedef struct _idler Idler;
typedef struct _animator Animator;
+typedef struct {
+ int x;
+ int y;
+ int w;
+ int h;
+} Area;
+
#endif /* _ETYPES_H_ */
diff --git a/src/ewmh.c b/src/ewmh.c
index 01552057..d89cdc3e 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2022 Kim Woelders
+ * Copyright (C) 2003-2023 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -213,27 +213,25 @@ EWMH_SetDesktopSize(void)
void
EWMH_SetWorkArea(void)
{
- unsigned int *p_coord;
- int n_coord, i, n_desks;
+ Area *wa;
+ int i, n_desks;
+ Desk *dsk;
n_desks = DesksGetNumber();
- n_coord = 4 * n_desks;
- p_coord = EMALLOC(unsigned int, n_coord);
+ wa = EMALLOC(Area, n_desks);
- if (!p_coord)
+ if (!wa)
return;
for (i = 0; i < n_desks; i++)
{
- p_coord[4 * i] = 0;
- p_coord[4 * i + 1] = 0;
- p_coord[4 * i + 2] = WinGetW(VROOT);
- p_coord[4 * i + 3] = WinGetH(VROOT);
+ dsk = DeskGet(i);
+ wa[i] = dsk->workarea;
}
- ex_netwm_desk_workareas_set(WinGetXwin(VROOT), p_coord, n_desks);
+ ex_netwm_desk_workareas_set(WinGetXwin(VROOT), (unsigned int *)wa, n_desks);
- Efree(p_coord);
+ Efree(wa);
}
void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.