move updatebarpos to statusbar.c
This commit is contained in:
parent
fe89aa31b0
commit
56a387ec5c
24
awesome.c
24
awesome.c
|
@ -226,30 +226,6 @@ get_windows_area_width(Display *disp,
|
||||||
return DisplayWidth(disp, DefaultScreen(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
|
/* 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
|
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
|
||||||
* default error handler, which may call exit.
|
* default error handler, which may call exit.
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#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 */
|
void uicb_quit(Display *, DC *, awesome_config *, const char *); /* quit awesome nicely */
|
||||||
int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
|
int xerror(Display *, XErrorEvent *); /* awesome's X error handler */
|
||||||
int __attribute__ ((deprecated)) get_windows_area_x(Statusbar);
|
int __attribute__ ((deprecated)) get_windows_area_x(Statusbar);
|
||||||
|
|
2
config.c
2
config.c
|
@ -30,8 +30,8 @@
|
||||||
#include "awesome.h"
|
#include "awesome.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "util.h"
|
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "util.h"
|
||||||
#include "layouts/tile.h"
|
#include "layouts/tile.h"
|
||||||
#include "layouts/spiral.h"
|
#include "layouts/spiral.h"
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
|
2
draw.h
2
draw.h
|
@ -22,7 +22,7 @@
|
||||||
#ifndef AWESOME_DRAW_H
|
#ifndef AWESOME_DRAW_H
|
||||||
#define 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)
|
#define textw(set, xfont, text, height) (textnw(set, xfont, text, a_strlen(text)) + height)
|
||||||
|
|
||||||
|
|
2
event.c
2
event.c
|
@ -25,13 +25,13 @@
|
||||||
#include <X11/extensions/shape.h>
|
#include <X11/extensions/shape.h>
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
|
||||||
#include "awesome.h"
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
|
#include "util.h"
|
||||||
#include "layouts/tile.h"
|
#include "layouts/tile.h"
|
||||||
#include "layouts/floating.h"
|
#include "layouts/floating.h"
|
||||||
|
|
||||||
|
|
27
statusbar.c
27
statusbar.c
|
@ -22,6 +22,8 @@
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "screen.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
extern Client *clients, *sel, *stack; /* global client list and stack */
|
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);
|
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, 0, 0);
|
||||||
XSync(disp, False);
|
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));
|
||||||
|
}
|
||||||
|
|
|
@ -25,5 +25,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
void drawstatusbar(Display *, DC *, awesome_config *);
|
void drawstatusbar(Display *, DC *, awesome_config *);
|
||||||
|
void updatebarpos(Display *, Statusbar);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue