move updatebarpos to statusbar.c

This commit is contained in:
Julien Danjou 2007-09-15 15:26:51 +02:00
parent fe89aa31b0
commit 56a387ec5c
7 changed files with 31 additions and 29 deletions

View File

@ -226,30 +226,6 @@ get_windows_area_width(Display *disp,
return DisplayWidth(disp, DefaultScreen(disp));
}
void
updatebarpos(Display *disp, Statusbar statusbar)
{
XEvent ev;
ScreenInfo *si;
switch (statusbar.position)
{
default:
XMoveWindow(disp, statusbar.window, 0, 0);
break;
case BarBot:
si = get_display_info(disp, statusbar);
XMoveWindow(disp, statusbar.window, 0, si->height);
XFree(si);
break;
case BarOff:
XMoveWindow(disp, statusbar.window, 0, 0 - statusbar.height);
break;
}
XSync(disp, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
}
/* There's no way to check accesses to destroyed windows, thus those cases are
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
* default error handler, which may call exit.

View File

@ -24,8 +24,6 @@
#include "config.h"
Bool gettextprop(Display *, Window, Atom, char *, unsigned int); /* return text property, UTF-8 compliant */
void updatebarpos(Display *, Statusbar); /* updates the bar position */
void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */
int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
int __attribute__ ((deprecated)) get_windows_area_x(Statusbar);

View File

@ -30,8 +30,8 @@
#include "awesome.h"
#include "layout.h"
#include "tag.h"
#include "util.h"
#include "draw.h"
#include "util.h"
#include "layouts/tile.h"
#include "layouts/spiral.h"
#include "layouts/floating.h"

2
draw.h
View File

@ -22,7 +22,7 @@
#ifndef AWESOME_DRAW_H
#define AWESOME_DRAW_H
#include "util.h"
#include "config.h"
#define textw(set, xfont, text, height) (textnw(set, xfont, text, a_strlen(text)) + height)

View File

@ -25,13 +25,13 @@
#include <X11/extensions/shape.h>
#include <X11/extensions/Xrandr.h>
#include "awesome.h"
#include "screen.h"
#include "event.h"
#include "layout.h"
#include "tag.h"
#include "draw.h"
#include "statusbar.h"
#include "util.h"
#include "layouts/tile.h"
#include "layouts/floating.h"

View File

@ -22,6 +22,8 @@
#include "layout.h"
#include "statusbar.h"
#include "draw.h"
#include "screen.h"
#include "util.h"
extern Client *clients, *sel, *stack; /* global client list and stack */
@ -85,3 +87,28 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, 0, 0);
XSync(disp, False);
}
void
updatebarpos(Display *disp, Statusbar statusbar)
{
XEvent ev;
ScreenInfo *si;
switch (statusbar.position)
{
default:
XMoveWindow(disp, statusbar.window, 0, 0);
break;
case BarBot:
si = get_display_info(disp, statusbar);
XMoveWindow(disp, statusbar.window, 0, si->height);
XFree(si);
break;
case BarOff:
XMoveWindow(disp, statusbar.window, 0, 0 - statusbar.height);
break;
}
XSync(disp, False);
while(XCheckMaskEvent(disp, EnterWindowMask, &ev));
}

View File

@ -25,5 +25,6 @@
#include "config.h"
void drawstatusbar(Display *, DC *, awesome_config *);
void updatebarpos(Display *, Statusbar);
#endif