desktops: Maintain separate workareas for each desktop
This commit is contained in:
parent
5ce609cca7
commit
214222e100
|
@ -447,6 +447,11 @@ _DeskCreate(int desk, int configure)
|
||||||
HintsSetRootInfo(EoGetWin(dsk), NoXID, 0);
|
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_BG_WIN_ON_ALL_DESKS /* TBD - Use per virtual root bg window? */
|
||||||
#if USE_COMPOSITE
|
#if USE_COMPOSITE
|
||||||
/* Add background window */
|
/* Add background window */
|
||||||
|
@ -749,6 +754,11 @@ _DeskResize(int desk, int w, int h)
|
||||||
_DeskControlsDestroy(dsk, 1);
|
_DeskControlsDestroy(dsk, 1);
|
||||||
_DeskControlsCreate(dsk);
|
_DeskControlsCreate(dsk);
|
||||||
_DeskControlsShow(dsk, 1);
|
_DeskControlsShow(dsk, 1);
|
||||||
|
|
||||||
|
dsk->workarea.x = 0;
|
||||||
|
dsk->workarea.y = 0;
|
||||||
|
dsk->workarea.w = w;
|
||||||
|
dsk->workarea.h = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
Desk *
|
Desk *
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct _desk {
|
||||||
Button *tag;
|
Button *tag;
|
||||||
int current_area_x;
|
int current_area_x;
|
||||||
int current_area_y;
|
int current_area_y;
|
||||||
|
Area workarea;
|
||||||
struct {
|
struct {
|
||||||
Background *bg;
|
Background *bg;
|
||||||
EObj *o;
|
EObj *o;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
* 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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
@ -57,4 +57,11 @@ typedef struct _timer Timer;
|
||||||
typedef struct _idler Idler;
|
typedef struct _idler Idler;
|
||||||
typedef struct _animator Animator;
|
typedef struct _animator Animator;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int w;
|
||||||
|
int h;
|
||||||
|
} Area;
|
||||||
|
|
||||||
#endif /* _ETYPES_H_ */
|
#endif /* _ETYPES_H_ */
|
||||||
|
|
22
src/ewmh.c
22
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
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
@ -213,27 +213,25 @@ EWMH_SetDesktopSize(void)
|
||||||
void
|
void
|
||||||
EWMH_SetWorkArea(void)
|
EWMH_SetWorkArea(void)
|
||||||
{
|
{
|
||||||
unsigned int *p_coord;
|
Area *wa;
|
||||||
int n_coord, i, n_desks;
|
int i, n_desks;
|
||||||
|
Desk *dsk;
|
||||||
|
|
||||||
n_desks = DesksGetNumber();
|
n_desks = DesksGetNumber();
|
||||||
n_coord = 4 * n_desks;
|
wa = EMALLOC(Area, n_desks);
|
||||||
p_coord = EMALLOC(unsigned int, n_coord);
|
|
||||||
|
|
||||||
if (!p_coord)
|
if (!wa)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < n_desks; i++)
|
for (i = 0; i < n_desks; i++)
|
||||||
{
|
{
|
||||||
p_coord[4 * i] = 0;
|
dsk = DeskGet(i);
|
||||||
p_coord[4 * i + 1] = 0;
|
wa[i] = dsk->workarea;
|
||||||
p_coord[4 * i + 2] = WinGetW(VROOT);
|
|
||||||
p_coord[4 * i + 3] = WinGetH(VROOT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
void
|
||||||
|
|
Loading…
Reference in New Issue