Screen/Infobar: Fix position with multi-head, add spgeo[] (screen pure geometry).
This commit is contained in:
parent
6eff09d790
commit
582f1a9481
@ -114,7 +114,7 @@ buttonpress(XButtonEvent *ev)
|
|||||||
{
|
{
|
||||||
if(conf.layout_system && (ev->button == Button1 || ev->button == Button3)) /* True -> menu */
|
if(conf.layout_system && (ev->button == Button1 || ev->button == Button3)) /* True -> menu */
|
||||||
{
|
{
|
||||||
y = infobar[selscreen].layout_button->geo.y + INFOBARH;
|
y = (sgeo[selscreen].y - (BORDH + TBARH)) + infobar[selscreen].layout_button->geo.y;
|
||||||
x = infobar[selscreen].layout_button->geo.x + (sgeo[selscreen].x - BORDH);
|
x = infobar[selscreen].layout_button->geo.x + (sgeo[selscreen].x - BORDH);
|
||||||
|
|
||||||
if(infobar[selscreen].geo.y != sgeo[selscreen].y - (INFOBARH + TBARH))
|
if(infobar[selscreen].geo.y != sgeo[selscreen].y - (INFOBARH + TBARH))
|
||||||
|
|||||||
@ -50,18 +50,18 @@ infobar_init(void)
|
|||||||
switch(tags[sc][seltag[sc]].barpos)
|
switch(tags[sc][seltag[sc]].barpos)
|
||||||
{
|
{
|
||||||
case IB_Hide:
|
case IB_Hide:
|
||||||
sgeo[sc].y = TBARH;
|
sgeo[sc].y = spgeo[sc].y + TBARH;
|
||||||
sgeo[selscreen].height += INFOBARH;
|
sgeo[sc].height += INFOBARH;
|
||||||
infobar[selscreen].geo.y = -(infobar[selscreen].geo.height) * 2;
|
infobar[sc].geo.y = -(infobar[sc].geo.height) * 2;
|
||||||
break;
|
break;
|
||||||
case IB_Bottom:
|
case IB_Bottom:
|
||||||
sgeo[selscreen].y = TBARH;
|
sgeo[sc].y = TBARH;
|
||||||
infobar[selscreen].geo.y = sgeo[selscreen].height + TBARH;
|
infobar[sc].geo.y = spgeo[sc].y + sgeo[sc].height + TBARH;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case IB_Top:
|
case IB_Top:
|
||||||
sgeo[sc].y = INFOBARH + TBARH;
|
sgeo[sc].y = spgeo[sc].y + INFOBARH + TBARH;
|
||||||
infobar[selscreen].geo.y = sgeo[selscreen].y - (INFOBARH + TBARH);
|
infobar[sc].geo.y = spgeo[sc].y;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,38 +191,26 @@ infobar_destroy(void)
|
|||||||
void
|
void
|
||||||
infobar_set_position(int pos)
|
infobar_set_position(int pos)
|
||||||
{
|
{
|
||||||
int th;
|
|
||||||
|
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
if(XineramaIsActive(dpy))
|
|
||||||
{
|
|
||||||
int n = 0;
|
|
||||||
XineramaScreenInfo *xsi = XineramaQueryScreens(dpy, &n);
|
|
||||||
|
|
||||||
th = xsi[selscreen].height;
|
|
||||||
XFree(xsi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
th = MAXH;
|
|
||||||
|
|
||||||
switch(pos)
|
switch(pos)
|
||||||
{
|
{
|
||||||
case IB_Hide:
|
case IB_Hide:
|
||||||
sgeo[selscreen].y = TBARH;
|
sgeo[selscreen].y = spgeo[selscreen].y + TBARH;
|
||||||
sgeo[selscreen].height = th - TBARH;
|
sgeo[selscreen].height = spgeo[selscreen].height - TBARH;
|
||||||
infobar[selscreen].geo.y = -(infobar[selscreen].geo.height) * 2;
|
infobar[selscreen].geo.y = -(infobar[selscreen].geo.height) * 2;
|
||||||
break;
|
break;
|
||||||
case IB_Bottom:
|
case IB_Bottom:
|
||||||
sgeo[selscreen].y = TBARH;
|
sgeo[selscreen].y = spgeo[selscreen].y + TBARH;
|
||||||
sgeo[selscreen].height = th - INFOBARH - TBARH;
|
sgeo[selscreen].height = spgeo[selscreen].height - INFOBARH - TBARH;
|
||||||
infobar[selscreen].geo.y = sgeo[selscreen].height + TBARH;
|
infobar[selscreen].geo.y = spgeo[selscreen].y + sgeo[selscreen].height + TBARH;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case IB_Top:
|
case IB_Top:
|
||||||
sgeo[selscreen].y = INFOBARH + TBARH;
|
sgeo[selscreen].y = spgeo[selscreen].y + INFOBARH + TBARH;
|
||||||
sgeo[selscreen].height = th - INFOBARH - TBARH;
|
sgeo[selscreen].height = spgeo[selscreen].height - INFOBARH - TBARH;
|
||||||
infobar[selscreen].geo.y = sgeo[selscreen].y - (INFOBARH + TBARH);
|
infobar[selscreen].geo.y = spgeo[selscreen].y;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -397,6 +397,7 @@ multi_tile(int screen, Position type)
|
|||||||
|
|
||||||
/** Mirror layout function
|
/** Mirror layout function
|
||||||
* \param screen Screen to execute this function
|
* \param screen Screen to execute this function
|
||||||
|
* \param horizont To specify the mirror mode (vertical/horizontal)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
mirror(int screen, Bool horizontal)
|
mirror(int screen, Bool horizontal)
|
||||||
|
|||||||
25
src/screen.c
25
src/screen.c
@ -70,6 +70,7 @@ screen_get_geo(int s)
|
|||||||
XineramaScreenInfo *xsi;
|
XineramaScreenInfo *xsi;
|
||||||
|
|
||||||
xsi = XineramaQueryScreens(dpy, &n);
|
xsi = XineramaQueryScreens(dpy, &n);
|
||||||
|
|
||||||
geo.x = xsi[s].x_org + BORDH;
|
geo.x = xsi[s].x_org + BORDH;
|
||||||
if(barpos == IB_Hide || barpos == IB_Bottom)
|
if(barpos == IB_Hide || barpos == IB_Bottom)
|
||||||
geo.y = TBARH;
|
geo.y = TBARH;
|
||||||
@ -168,13 +169,35 @@ screen_get_sel(void)
|
|||||||
void
|
void
|
||||||
screen_init_geo(void)
|
screen_init_geo(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i, n;
|
||||||
|
XineramaScreenInfo *xsi;
|
||||||
|
|
||||||
sgeo = emalloc(screen_count(), sizeof(XRectangle));
|
sgeo = emalloc(screen_count(), sizeof(XRectangle));
|
||||||
|
spgeo = emalloc(screen_count(), sizeof(XRectangle));
|
||||||
|
|
||||||
for(i = 0; i < screen_count(); ++i)
|
for(i = 0; i < screen_count(); ++i)
|
||||||
sgeo[i] = screen_get_geo(i);
|
sgeo[i] = screen_get_geo(i);
|
||||||
|
|
||||||
|
if(XineramaIsActive(dpy))
|
||||||
|
{
|
||||||
|
xsi = XineramaQueryScreens(dpy, &n);
|
||||||
|
for(i = 0; i < n; ++i)
|
||||||
|
{
|
||||||
|
spgeo[i].x = xsi[i].x_org;
|
||||||
|
spgeo[i].y = xsi[i].y_org;
|
||||||
|
spgeo[i].width = xsi[i].width;
|
||||||
|
spgeo[i].height = xsi[i].height;
|
||||||
|
}
|
||||||
|
XFree(xsi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spgeo[0].x = 0;
|
||||||
|
spgeo[0].y = 0;
|
||||||
|
spgeo[0].width = MAXW;
|
||||||
|
spgeo[0].height = MAXH;
|
||||||
|
}
|
||||||
|
|
||||||
ewmh_set_desktop_geometry();
|
ewmh_set_desktop_geometry();
|
||||||
ewmh_set_workarea();
|
ewmh_set_workarea();
|
||||||
|
|
||||||
|
|||||||
@ -106,6 +106,7 @@ quit(void)
|
|||||||
infobar_destroy();
|
infobar_destroy();
|
||||||
|
|
||||||
IFREE(sgeo);
|
IFREE(sgeo);
|
||||||
|
IFREE(spgeo);
|
||||||
IFREE(infobar);
|
IFREE(infobar);
|
||||||
IFREE(keys);
|
IFREE(keys);
|
||||||
IFREE(func_list);
|
IFREE(func_list);
|
||||||
|
|||||||
@ -311,6 +311,7 @@ Key *keys;
|
|||||||
Bool exiting;
|
Bool exiting;
|
||||||
char statustext[1024];
|
char statustext[1024];
|
||||||
XRectangle *sgeo;
|
XRectangle *sgeo;
|
||||||
|
XRectangle *spgeo;
|
||||||
Cursor cursor[CurLast];
|
Cursor cursor[CurLast];
|
||||||
|
|
||||||
/* Fonts */
|
/* Fonts */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user