stop using get_window_area* fct, and remove it
This commit is contained in:
parent
57bb886dae
commit
1cd4ba0086
2
TODO
2
TODO
|
@ -1,7 +1,5 @@
|
||||||
For v1.0:
|
For v1.0:
|
||||||
- Add uicb for sel->border++-- and awesomeconf->border++--
|
- Add uicb for sel->border++-- and awesomeconf->border++--
|
||||||
- Remove warnings
|
|
||||||
- Check togglemax
|
|
||||||
- Write manpage
|
- Write manpage
|
||||||
|
|
||||||
For future:
|
For future:
|
||||||
|
|
31
awesome.c
31
awesome.c
|
@ -239,37 +239,6 @@ uicb_quit(Display *disp __attribute__ ((unused)),
|
||||||
readin = running = False;
|
readin = running = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
get_windows_area_x(Statusbar statusbar __attribute__ ((unused)))
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
get_windows_area_y(Statusbar statusbar)
|
|
||||||
{
|
|
||||||
if(statusbar.position == BarTop)
|
|
||||||
return statusbar.height;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
get_windows_area_height(Display *disp, Statusbar statusbar)
|
|
||||||
{
|
|
||||||
if(statusbar.position == BarTop || statusbar.position == BarBot)
|
|
||||||
return DisplayHeight(disp, DefaultScreen(disp)) - statusbar.height;
|
|
||||||
|
|
||||||
return DisplayHeight(disp, DefaultScreen(disp));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
get_windows_area_width(Display *disp,
|
|
||||||
Statusbar statusbar __attribute__ ((unused)))
|
|
||||||
{
|
|
||||||
return DisplayWidth(disp, DefaultScreen(disp));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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.
|
||||||
|
|
|
@ -26,9 +26,5 @@
|
||||||
|
|
||||||
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_y(Statusbar);
|
|
||||||
int __attribute__ ((deprecated)) get_windows_area_height(Display *, Statusbar);
|
|
||||||
int __attribute__ ((deprecated)) get_windows_area_width(Display *, Statusbar);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
18
event.c
18
event.c
|
@ -60,7 +60,7 @@ movemouse(Client * c, int screen, awesome_config *awesomeconf)
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
ScreenInfo *si;
|
ScreenInfo *si;
|
||||||
|
|
||||||
si = get_display_info(c->display, c->screen, awesomeconf[screen].statusbar);
|
si = get_screen_info(c->display, c->screen, awesomeconf[screen].statusbar, &x1);
|
||||||
|
|
||||||
ocx = nx = c->x;
|
ocx = nx = c->x;
|
||||||
ocy = ny = c->y;
|
ocy = ny = c->y;
|
||||||
|
@ -85,14 +85,14 @@ movemouse(Client * c, int screen, awesome_config *awesomeconf)
|
||||||
XSync(c->display, False);
|
XSync(c->display, False);
|
||||||
nx = ocx + (ev.xmotion.x - x1);
|
nx = ocx + (ev.xmotion.x - x1);
|
||||||
ny = ocy + (ev.xmotion.y - y1);
|
ny = ocy + (ev.xmotion.y - y1);
|
||||||
if(abs(si->x_org + nx) < awesomeconf[screen].snap)
|
if(abs(si[c->screen].x_org + nx) < awesomeconf[screen].snap)
|
||||||
nx = si->x_org;
|
nx = si[c->screen].x_org;
|
||||||
else if(abs((si->x_org + si->width) - (nx + c->w + 2 * c->border)) < awesomeconf[screen].snap)
|
else if(abs((si[c->screen].x_org + si[c->screen].width) - (nx + c->w + 2 * c->border)) < awesomeconf[screen].snap)
|
||||||
nx = si->x_org + si->width - c->w - 2 * c->border;
|
nx = si[c->screen].x_org + si[c->screen].width - c->w - 2 * c->border;
|
||||||
if(abs(si->y_org - ny) < awesomeconf[screen].snap)
|
if(abs(si[c->screen].y_org - ny) < awesomeconf[screen].snap)
|
||||||
ny = si->y_org;
|
ny = si[c->screen].y_org;
|
||||||
else if(abs((si->y_org + si->height) - (ny + c->h + 2 * c->border)) < awesomeconf[screen].snap)
|
else if(abs((si[c->screen].y_org + si[c->screen].height) - (ny + c->h + 2 * c->border)) < awesomeconf[screen].snap)
|
||||||
ny = si->y_org + si->height - c->h - 2 * c->border;
|
ny = si[c->screen].y_org + si[c->screen].height - c->h - 2 * c->border;
|
||||||
resize(c, nx, ny, c->w, c->h, False);
|
resize(c, nx, ny, c->w, c->h, False);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
39
layout.c
39
layout.c
|
@ -22,7 +22,7 @@
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
|
||||||
#include "awesome.h"
|
#include "screen.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -228,12 +228,13 @@ uicb_togglemax(Display *disp,
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
maximize(get_windows_area_x(awesomeconf->statusbar),
|
int dummy;
|
||||||
get_windows_area_y(awesomeconf->statusbar),
|
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||||
get_windows_area_width(disp, awesomeconf->statusbar) - 2 * awesomeconf->borderpx,
|
|
||||||
get_windows_area_height(disp, awesomeconf->statusbar) - 2 * awesomeconf->borderpx,
|
maximize(si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org,
|
||||||
drawcontext,
|
si[awesomeconf->screen].width - 2 * awesomeconf->borderpx,
|
||||||
awesomeconf);
|
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||||
|
drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -242,13 +243,13 @@ uicb_toggleverticalmax(Display *disp,
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
int dummy;
|
||||||
|
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||||
|
|
||||||
if(sel)
|
if(sel)
|
||||||
maximize(sel->x,
|
maximize(sel->x, si[awesomeconf->screen].y_org,
|
||||||
get_windows_area_y(awesomeconf->statusbar),
|
sel->w, si[awesomeconf->screen].height - 2 * awesomeconf->borderpx,
|
||||||
sel->w,
|
drawcontext, awesomeconf);
|
||||||
get_windows_area_height(disp, awesomeconf->statusbar) - 2 * awesomeconf->borderpx,
|
|
||||||
drawcontext,
|
|
||||||
awesomeconf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,13 +259,13 @@ uicb_togglehorizontalmax(Display *disp,
|
||||||
awesome_config *awesomeconf,
|
awesome_config *awesomeconf,
|
||||||
const char *arg __attribute__ ((unused)))
|
const char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
int dummy;
|
||||||
|
ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy);
|
||||||
|
|
||||||
if(sel)
|
if(sel)
|
||||||
maximize(get_windows_area_x(awesomeconf->statusbar),
|
maximize(si[awesomeconf->screen].x_org, sel->y,
|
||||||
sel->y,
|
si[awesomeconf->screen].height - 2 * awesomeconf->borderpx, sel->h,
|
||||||
get_windows_area_height(disp, awesomeconf->statusbar) - 2 * awesomeconf->borderpx,
|
drawcontext, awesomeconf);
|
||||||
sel->h,
|
|
||||||
drawcontext,
|
|
||||||
awesomeconf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue