mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
- Fixed wrong display position for the move/resize widgets
patch (Peter Zijlstra <a.p.zijlstra@chello.nl>)
This commit is contained in:
@@ -50,6 +50,8 @@ Changes since version 0.80.2:
|
||||
which also happens in this case, since shading is a form of miniaturization)
|
||||
- Fixed bug with tpixmap from previous xinerama patch
|
||||
- Fixed edge resistance and move/resize frame drawing for borderless windows
|
||||
- Fixed wrong display position for the move/resize widgets after xinerama
|
||||
patch (Peter Zijlstra <a.p.zijlstra@chello.nl>)
|
||||
|
||||
|
||||
Changes since version 0.80.1:
|
||||
|
||||
@@ -119,15 +119,12 @@ moveGeometryDisplayCentered(WScreen *scr, int x, int y)
|
||||
{
|
||||
unsigned int w = WMWidgetWidth(scr->gview);
|
||||
unsigned int h = WMWidgetHeight(scr->gview);
|
||||
unsigned int x1 = 0, y1 = 0, x2 = scr->scr_width, y2 = scr->scr_height;
|
||||
|
||||
int x1 = 0, y1 = 0, x2 = scr->scr_width, y2 = scr->scr_height;
|
||||
|
||||
x -= w / 2;
|
||||
y -= h / 2;
|
||||
|
||||
/*
|
||||
* dead area check
|
||||
*/
|
||||
/* dead area check */
|
||||
if (scr->xine_count) {
|
||||
WMRect rect;
|
||||
int head, flags;
|
||||
@@ -200,6 +197,7 @@ static void
|
||||
cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
WMRect rect;
|
||||
|
||||
wPreferences.move_display++;
|
||||
wPreferences.move_display %= NUM_DISPLAYS;
|
||||
@@ -213,12 +211,12 @@ cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
WMUnmapWidget(scr->gview);
|
||||
} else {
|
||||
if (wPreferences.move_display == WDIS_CENTER) {
|
||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.width/2);
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.move_display == WDIS_TOPLEFT) {
|
||||
moveGeometryDisplayCentered(scr, 1, 1);
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + 1, rect.pos.y + 1);
|
||||
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) {
|
||||
moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
|
||||
}
|
||||
@@ -231,17 +229,19 @@ static void
|
||||
mapPositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
WMRect rect;
|
||||
|
||||
if (wPreferences.move_display == WDIS_NEW
|
||||
|| wPreferences.move_display == WDIS_NONE) {
|
||||
return;
|
||||
} else if (wPreferences.move_display == WDIS_CENTER) {
|
||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.width/2);
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.move_display == WDIS_TOPLEFT) {
|
||||
moveGeometryDisplayCentered(scr, 1, 1);
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + 1, rect.pos.y + 1);
|
||||
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) {
|
||||
moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
|
||||
}
|
||||
@@ -293,8 +293,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
||||
}
|
||||
my = (ty + by) / 2;
|
||||
|
||||
/* top arrow */
|
||||
/* end bar */
|
||||
/* top arrow & end bar */
|
||||
segment[0].x1 = x - (s + 6); segment[0].y1 = ty;
|
||||
segment[0].x2 = x - (s - 10); segment[0].y2 = ty;
|
||||
|
||||
@@ -311,8 +310,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
||||
|
||||
XDrawSegments(dpy, root, gc, segment, 4);
|
||||
|
||||
/* bottom arrow */
|
||||
/* end bar */
|
||||
/* bottom arrow & end bar */
|
||||
segment[0].y1 = by;
|
||||
segment[0].y2 = by;
|
||||
|
||||
@@ -363,8 +361,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
||||
wwin->normal_hints->width_inc);
|
||||
fw = WMWidthOfString(scr->tech_draw_font, num, strlen(num));
|
||||
|
||||
/* left arrow */
|
||||
/* end bar */
|
||||
/* left arrow & end bar */
|
||||
segment[0].x1 = x1; segment[0].y1 = y - (s + 6);
|
||||
segment[0].x2 = x1; segment[0].y2 = y - (s - 10);
|
||||
|
||||
@@ -381,8 +378,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
|
||||
|
||||
XDrawSegments(dpy, root, gc, segment, 4);
|
||||
|
||||
/* right arrow */
|
||||
/* end bar */
|
||||
/* right arrow & end bar */
|
||||
segment[0].x1 = x2 + 1;
|
||||
segment[0].x2 = x2 + 1;
|
||||
|
||||
@@ -424,6 +420,7 @@ static void
|
||||
cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
WMRect rect;
|
||||
|
||||
wPreferences.size_display++;
|
||||
wPreferences.size_display %= NUM_DISPLAYS;
|
||||
@@ -433,12 +430,13 @@ cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
|
||||
WMUnmapWidget(scr->gview);
|
||||
} else {
|
||||
if (wPreferences.size_display == WDIS_CENTER) {
|
||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.width/2);
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.size_display == WDIS_TOPLEFT) {
|
||||
moveGeometryDisplayCentered(scr, 1, 1);
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + 1, rect.pos.y + 1);
|
||||
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) {
|
||||
moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
|
||||
}
|
||||
@@ -452,18 +450,20 @@ static void
|
||||
mapGeometryDisplay(WWindow *wwin, int x, int y, int w, int h)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
WMRect rect;
|
||||
|
||||
if (wPreferences.size_display == WDIS_NEW
|
||||
|| wPreferences.size_display == WDIS_NONE)
|
||||
return;
|
||||
|
||||
if (wPreferences.size_display == WDIS_CENTER) {
|
||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr,
|
||||
rect.pos.x + rect.size.width/2,
|
||||
rect.pos.y + rect.size.width/2);
|
||||
rect.pos.y + rect.size.height/2);
|
||||
} else if (wPreferences.size_display == WDIS_TOPLEFT) {
|
||||
moveGeometryDisplayCentered(scr, 1, 1);
|
||||
rect = wGetRectForHead(scr, wGetHeadForWindow(wwin));
|
||||
moveGeometryDisplayCentered(scr, rect.pos.x + 1, rect.pos.y + 1);
|
||||
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) {
|
||||
moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
|
||||
}
|
||||
@@ -854,9 +854,8 @@ updateMoveData(WWindow *wwin, MoveData *data)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* order from closest to the border of the screen to farthest
|
||||
*/
|
||||
/* order from closest to the border of the screen to farthest */
|
||||
|
||||
qsort(data->topList, data->count, sizeof(WWindow**), compareWTop);
|
||||
qsort(data->leftList, data->count, sizeof(WWindow**), compareWLeft);
|
||||
qsort(data->rightList, data->count, sizeof(WWindow**), compareWRight);
|
||||
@@ -1051,13 +1050,12 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
|
||||
attract = wPreferences.attract;
|
||||
/* horizontal movement: check horizontal edge resistances */
|
||||
if (dx || dy) {
|
||||
WMRect rect;
|
||||
int i;
|
||||
/* window is the leftmost window: check against screen edge */
|
||||
|
||||
/*
|
||||
* Add inter head resistance 1/2 (if needed)
|
||||
*/
|
||||
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
/* Add inter head resistance 1/2 (if needed) */
|
||||
rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||
|
||||
l_edge = WMAX(scr->totalUsableArea.x1, rect.pos.x);
|
||||
edge_l = l_edge - resist;
|
||||
@@ -1158,9 +1156,7 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
|
||||
}
|
||||
|
||||
/* VeRT */
|
||||
/*
|
||||
* Add inter head resistance 2/2 (if needed)
|
||||
*/
|
||||
/* Add inter head resistance 2/2 (if needed) */
|
||||
t_edge = WMAX(scr->totalUsableArea.y1, rect.pos.y);
|
||||
edge_t = t_edge - resist;
|
||||
edge_b = WMIN(scr->totalUsableArea.y2, rect.pos.y + rect.size.height);
|
||||
@@ -1701,7 +1697,7 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
|
||||
Window junkw;
|
||||
|
||||
/* XWarpPointer() doesn't seem to generate Motion events, so
|
||||
we've got to simulate them */
|
||||
* we've got to simulate them */
|
||||
XQueryPointer(dpy, root, &junkw, &junkw, &event.xmotion.x_root,
|
||||
&event.xmotion.y_root, &junk, &junk,
|
||||
(unsigned *) &junk);
|
||||
|
||||
Reference in New Issue
Block a user