stop using deprecated get_windows_area*()

This commit is contained in:
Julien Danjou 2007-09-14 12:01:39 +02:00
parent 59c870db3e
commit fda58db5f6
1 changed files with 13 additions and 12 deletions

25
event.c
View File

@ -26,6 +26,7 @@
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#include "awesome.h" #include "awesome.h"
#include "screen.h"
#include "event.h" #include "event.h"
#include "layout.h" #include "layout.h"
#include "tag.h" #include "tag.h"
@ -55,10 +56,9 @@ movemouse(Client * c, awesome_config *awesomeconf)
unsigned int dui; unsigned int dui;
Window dummy; Window dummy;
XEvent ev; XEvent ev;
int wax = get_windows_area_x(awesomeconf->statusbar); ScreenInfo *si;
int way = get_windows_area_y(awesomeconf->statusbar);
int waw = get_windows_area_width(c->display, awesomeconf->statusbar); si = get_display_info(c->display, awesomeconf->statusbar);
int wah = get_windows_area_height(c->display, awesomeconf->statusbar);
ocx = nx = c->x; ocx = nx = c->x;
ocy = ny = c->y; ocy = ny = c->y;
@ -83,18 +83,19 @@ movemouse(Client * c, 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(wax + nx) < awesomeconf->snap) if(abs(si->x_org + nx) < awesomeconf->snap)
nx = wax; nx = si->x_org;
else if(abs((wax + waw) - (nx + c->w + 2 * c->border)) < awesomeconf->snap) else if(abs((si->x_org + si->width) - (nx + c->w + 2 * c->border)) < awesomeconf->snap)
nx = wax + waw - c->w - 2 * c->border; nx = si->x_org + si->width - c->w - 2 * c->border;
if(abs(way - ny) < awesomeconf->snap) if(abs(si->y_org - ny) < awesomeconf->snap)
ny = way; ny = si->y_org;
else if(abs((way + wah) - (ny + c->h + 2 * c->border)) < awesomeconf->snap) else if(abs((si->y_org + si->height) - (ny + c->h + 2 * c->border)) < awesomeconf->snap)
ny = way + wah - c->h - 2 * c->border; ny = si->y_org + si->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;
} }
} }
XFree(si);
} }
static void static void