forked from e16/e16
1
0
Fork 0

desktops: Maintain separate workareas for each desktop

This commit is contained in:
Kim Woelders 2023-10-15 15:22:31 +02:00
parent 5ce609cca7
commit 214222e100
4 changed files with 29 additions and 13 deletions

View File

@ -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 *

View File

@ -43,6 +43,7 @@ struct _desk {
Button *tag;
int current_area_x;
int current_area_y;
Area workarea;
struct {
Background *bg;
EObj *o;

View File

@ -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_ */

View File

@ -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