This commit is contained in:
Martin Duquesnoy
2008-11-06 00:26:12 +01:00
parent d46b0d4044
commit 62f2e40ff4
4 changed files with 34 additions and 22 deletions

View File

@@ -326,12 +326,12 @@ mouseaction(Client *c, int x, int y, int type)
mx = sgeo.width - (tags[seltag].mwfact * sgeo.width);
else if(tags[seltag].layout.func == tile_top)
{
mx = event.xmotion.x;
mx = event.xmotion.x_root;
my = sgeo.height - (tags[seltag].mwfact * sgeo.height);
}
else if(tags[seltag].layout.func == tile_bottom)
{
mx = event.xmotion.x;
mx = event.xmotion.x_root;
my = tags[seltag].mwfact * sgeo.height;
}
XWarpPointer(dpy, None, root, 0, 0, 0, 0, mx, my);

View File

@@ -32,6 +32,33 @@
#include "wmfs.h"
void
infobar_init(InfoBar *ib)
{
ib->geo.height = fonth + (float)4.5;
ib->geo.y = (conf.bartop) ? 0 : mh - ib->geo.height;
/* Create infobar barwindow */
ib->bar = bar_create(0, ib->geo.y, mw, ib->geo.height, 0, conf.colors.bar, False);
/* Create layout switch & layout type switch barwindow */
ib->layout_switch = bar_create(0, (conf.bartop) ? ib->geo.y : ib->geo.y + 1,
1, ib->geo.height - 1, 0,
conf.colors.layout_bg, False);
ib->layout_type_switch = bar_create(0, ib->geo.y,
1, ib->geo.height,
0, conf.colors.layout_bg, False);
/* Map all */
bar_map(ib->bar);
bar_map(ib->layout_switch);
strcpy(ib->statustext, "WMFS-" WMFS_VERSION);
infobar_draw();
return;
}
void
infobar_draw(void)
{
@@ -99,11 +126,8 @@ infobar_draw_layout(void)
width += textw(symbol) + PAD;
bar_refresh(infobar.layout_switch);
if(tags[seltag].layout.func == tile
|| tags[seltag].layout.func == tile_left
|| tags[seltag].layout.func == tile_top
|| tags[seltag].layout.func == tile_bottom
|| tags[seltag].layout.func == grid)
if(tags[seltag].layout.func != freelayout
&& tags[seltag].layout.func != maxlayout)
{
bar_map(infobar.layout_type_switch);
bar_refresh_color(infobar.layout_type_switch);

View File

@@ -132,7 +132,6 @@ init(void)
xftfont = XftFontOpenName(dpy, screen, "sans-10");
}
fonth = (xftfont->ascent + xftfont->descent);
infobar.geo.height = fonth + (float)4.5;
/* INIT CURSOR */
cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
@@ -166,20 +165,8 @@ init(void)
if(conf.root.background_command)
uicb_spawn(conf.root.background_command);
/* INIT BAR / BUTTON */
/* bar */
infobar.geo.y = (conf.bartop) ? 0 : mh - infobar.geo.height;
infobar.bar = bar_create(0, infobar.geo.y, mw, infobar.geo.height, 0, conf.colors.bar, False);
/* layout button */
infobar.layout_switch = bar_create(0, (conf.bartop) ? infobar.geo.y : infobar.geo.y + 1,
1, infobar.geo.height - 1, 0,
conf.colors.layout_bg, False);
infobar.layout_type_switch = bar_create(0, infobar.geo.y, 1, infobar.geo.height, 0, conf.colors.layout_bg, False);
bar_map(infobar.bar);
bar_map(infobar.layout_switch);
strcpy(infobar.statustext, "WMFS-" WMFS_VERSION);
infobar_draw();
/* INIT INFOBAR */
infobar_init(&infobar);
/* INIT WORKABLE SPACE GEOMETRY */
sgeo.x = 0;

View File

@@ -77,6 +77,7 @@ void draw_rectangle(Drawable dr, int x, int y, uint w, uint h, uint color);
ushort textw(const char *text);
/* infobar.c */
void infobar_init(InfoBar *ib);
void infobar_draw(void);
void infobar_draw_layout(void);
void infobar_draw_taglist(Drawable dr);