No need to query pointer in move/resize start.
SVN revision: 46171
This commit is contained in:
parent
7e909c0907
commit
84cedde03c
|
@ -367,7 +367,7 @@ EventsInit(void)
|
|||
}
|
||||
|
||||
int
|
||||
EventsGetXY(int *px, int *py)
|
||||
EventsUpdateXY(int *px, int *py)
|
||||
{
|
||||
int ss;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2008 Kim Woelders
|
||||
* Copyright (C) 2006-2010 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -46,6 +46,6 @@ typedef void (EventFdHandler) (void);
|
|||
EventFdDesc *EventFdRegister(int fd, EventFdHandler * handler);
|
||||
void EventFdUnregister(EventFdDesc * efd);
|
||||
|
||||
int EventsGetXY(int *px, int *py);
|
||||
int EventsUpdateXY(int *px, int *py);
|
||||
|
||||
#endif /* _EVENTS_H_ */
|
||||
|
|
13
src/ewins.c
13
src/ewins.c
|
@ -859,7 +859,7 @@ AddToFamily(EWin * ewin, Window xwin, int startup)
|
|||
/* the window there */
|
||||
DeskGoto(dsk);
|
||||
|
||||
EventsGetXY(&cx, &cy);
|
||||
EventsUpdateXY(&cx, &cy);
|
||||
|
||||
/* try to center the window on the mouse pointer */
|
||||
cx -= EoGetW(ewin) / 2;
|
||||
|
@ -907,19 +907,18 @@ AddToFamily(EWin * ewin, Window xwin, int startup)
|
|||
/* if we should slide it in and are not currently in the middle of a slide */
|
||||
if ((manplace) && (!ewin->state.placed))
|
||||
{
|
||||
int rx, ry;
|
||||
int cx, cy;
|
||||
|
||||
/* if the loser has manual placement on and the app asks to be on */
|
||||
/* a desktop, then send E to that desktop so the user can place */
|
||||
/* the window there */
|
||||
DeskGoto(dsk);
|
||||
|
||||
EQueryPointer(NULL, &rx, &ry, NULL, NULL);
|
||||
Mode.events.cx = rx;
|
||||
Mode.events.cy = ry;
|
||||
EventsUpdateXY(&cx, &cy);
|
||||
|
||||
ewin->state.placed = 1;
|
||||
x = Mode.events.cx - 8;
|
||||
y = Mode.events.cy - 8;
|
||||
x = cx - 8;
|
||||
y = cy - 8;
|
||||
GrabPointerSet(VROOT, ECSR_GRAB, 0);
|
||||
EoSetFloating(ewin, 1); /* Causes reparenting to root */
|
||||
EwinOpFloatAt(ewin, OPSRC_USER, x, y);
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "cursors.h"
|
||||
#include "desktops.h"
|
||||
#include "emodule.h"
|
||||
#include "events.h"
|
||||
#include "ewins.h"
|
||||
#include "focus.h"
|
||||
#include "grabs.h"
|
||||
|
@ -98,7 +97,8 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
|
|||
Mode_mr.using_kbd = kbd;
|
||||
Mode_mr.nogroup = nogroup;
|
||||
|
||||
EventsGetXY(&cx, &cy);
|
||||
cx = Mode.events.cx;
|
||||
cy = Mode.events.cy;
|
||||
|
||||
SoundPlay(SOUND_MOVE_START);
|
||||
|
||||
|
@ -305,7 +305,8 @@ MoveResizeResizeStart(EWin * ewin, int kbd, int hv)
|
|||
|
||||
Mode_mr.ewin = ewin;
|
||||
|
||||
EventsGetXY(&cx, &cy);
|
||||
cx = Mode.events.cx;
|
||||
cy = Mode.events.cy;
|
||||
|
||||
SoundPlay(SOUND_RESIZE_START);
|
||||
|
||||
|
|
Loading…
Reference in New Issue