Avoid ETranslateCoordinates in window mode.

SVN revision: 46525
This commit is contained in:
Kim Woelders 2010-02-26 21:54:55 +00:00
parent 6156de7fce
commit c45f034ced
4 changed files with 16 additions and 17 deletions

View File

@ -406,7 +406,7 @@ typedef struct {
char exit_now;
char save_ok;
char coredump;
int win_w, win_h;
int win_x, win_y, win_w, win_h;
int exit_mode;
char *exit_param;
int child_count;

View File

@ -1970,8 +1970,14 @@ DeskHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
break;
case ConfigureNotify:
if (ev->xconfigure.window == WinGetXwin(VROOT))
DeskRootResize(0, ev->xconfigure.width, ev->xconfigure.height);
if (ev->xconfigure.window != WinGetXwin(VROOT))
break;
if (Mode.wm.window) /* This test should not be necessary but... */
{
Mode.wm.win_x = ev->xconfigure.x;
Mode.wm.win_y = ev->xconfigure.y;
}
DeskRootResize(0, ev->xconfigure.width, ev->xconfigure.height);
break;
case PropertyNotify:

View File

@ -381,16 +381,9 @@ EventsUpdateXY(int *px, int *py)
static void
ModeGetXY(int rx, int ry)
{
if (Mode.wm.window)
{
ETranslateCoordinates(RROOT, VROOT, rx, ry,
&Mode.events.cx, &Mode.events.cy, NULL);
}
else
{
Mode.events.cx = rx;
Mode.events.cy = ry;
}
/* Mode.wm.win_x/y should always be 0 if not in window mode */
Mode.events.cx = rx - Mode.wm.win_x;
Mode.events.cy = ry - Mode.wm.win_y;
}
static void

View File

@ -274,7 +274,6 @@ void
ICCCM_Configure(EWin * ewin)
{
XEvent ev;
Window child;
if (EwinIsInternal(ewin))
return;
@ -294,9 +293,10 @@ ICCCM_Configure(EWin * ewin)
ev.xconfigure.y = ewin->client.y;
#endif
if (Mode.wm.window)
ETranslateCoordinates(VROOT, RROOT,
ev.xconfigure.x, ev.xconfigure.y,
&ev.xconfigure.x, &ev.xconfigure.y, &child);
{
ev.xconfigure.x += Mode.wm.win_x;
ev.xconfigure.y += Mode.wm.win_y;
}
ev.xconfigure.width = ewin->client.w;
ev.xconfigure.height = ewin->client.h;
ev.xconfigure.border_width = 0;