Sat Mar 25 18:16:11 PST 2000

(Mandrake)

slightly better arranger code for XINERAMA - this should ALSO fix a couple of
KDE arranger problems that people reported, too.


SVN revision: 2334
This commit is contained in:
Mandrake 2000-03-26 02:04:48 +00:00
parent a79b0c41c4
commit 6c4cc0a561
15 changed files with 191 additions and 179 deletions

View File

@ -4444,3 +4444,11 @@ some things will still pop up inbetween heads, but for the most part windows
will pop up on the head that is currently focused and will pop up without
going between heads.
-------------------------------------------------------------------------------
Sat Mar 25 18:16:11 PST 2000
(Mandrake)
slightly better arranger code for XINERAMA - this should ALSO fix a couple of
KDE arranger problems that people reported, too.

View File

@ -1181,11 +1181,11 @@ doMoveEnd(void *params)
if (gwins[i]->floating)
MoveEwinToDesktopAt(gwins[i], d,
gwins[i]->x - (desks.desk[d].x -
desks.
desk[gwins[i]->desktop].x),
desks.desk[gwins[i]->
desktop].x),
gwins[i]->y - (desks.desk[d].y -
desks.
desk[gwins[i]->desktop].y));
desks.desk[gwins[i]->
desktop].y));
else
MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y);
gwins[i]->floating = 0;

View File

@ -357,13 +357,13 @@ SetCurrentArea(int ax, int ay)
lst[i]->x -
(root.w *
(ax -
desks.desk[desks.
current].current_area_x)),
desks.desk[desks.current].
current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.
current].current_area_y)));
desks.desk[desks.current].
current_area_y)));
if (setflip)
mode.flipp = 0;
lst[i]->area_x = a1;
@ -394,13 +394,13 @@ SetCurrentArea(int ax, int ay)
x -
(root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
desks.desk[desks.
current].current_area_x)),
y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
desks.desk[desks.
current].current_area_y)));
}
}
/* if we're not moving it... move it across */
@ -419,13 +419,13 @@ SetCurrentArea(int ax, int ay)
lst[i]->x -
(root.w *
(ax -
desks.desk[desks.
current].current_area_x)),
desks.desk[desks.current].
current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.
current].current_area_y)));
desks.desk[desks.current].
current_area_y)));
if (setflip)
mode.flipp = 0;
lst[i]->area_x = a1;

View File

@ -130,6 +130,10 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
height =
screens[i].y_org +
screens[i].height;
printf("head %d\nstartx = %d\nstarty = %d"
"\nwidth = %d\nheight = %d\n", i,
startx, starty, width, height);
fflush(stdout);
}
}
}
@ -377,27 +381,45 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if ((spaces[j].w >= floating[i].w) &&
(spaces[j].h >= floating[i].h))
{
if (policy == ARRANGE_BY_POSITION)
if (spaces[j].x >= startx)
{
a1 = (spaces[j].x + (spaces[j].w >> 1)) -
(floating[i].x + (floating[i].w >> 1));
a2 = (spaces[j].y + (spaces[j].h >> 1)) -
(floating[i].y + (floating[i].h >> 1));
if (a1 < 0)
a1 = -a1;
if (a2 < 0)
a2 = -a2;
if ((a1 + a2) < sort)
if ((spaces[j].x + spaces[j].w) <= width)
{
sort = a1 + a2;
k = j;
if (spaces[j].y >= starty)
{
if ((spaces[j].y + spaces[j].h) <= height)
{
if (policy == ARRANGE_BY_POSITION)
{
a1 =
(spaces[j].x +
(spaces[j].w >> 1)) -
(floating[i].x +
(floating[i].w >> 1));
a2 =
(spaces[j].y +
(spaces[j].h >> 1)) -
(floating[i].y +
(floating[i].h >> 1));
if (a1 < 0)
a1 = -a1;
if (a2 < 0)
a2 = -a2;
if ((a1 + a2) < sort)
{
sort = a1 + a2;
k = j;
}
}
else
{
k = j;
j = num_spaces;
}
}
}
}
}
else
{
k = j;
j = num_spaces;
}
}
}
if (k >= 0)

View File

@ -1177,12 +1177,12 @@ CalcEwinWinpart(EWin * ewin, int i)
if (bottomright == -1)
{
ox =
((ewin->
border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) +
((ewin->border->
part[i].geom.bottomright.x.percent * ewin->w) >> 10) +
ewin->border->part[i].geom.bottomright.x.absolute;
oy =
((ewin->
border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) +
((ewin->border->
part[i].geom.bottomright.y.percent * ewin->h) >> 10) +
ewin->border->part[i].geom.bottomright.y.absolute;
}
else if (bottomright >= 0)
@ -2593,8 +2593,9 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
(ewin->w - ewin->border->border.right) > rightborderwidth)
rightborderwidth =
(ewin->bits[i].x + ewin->bits[i].w) - (ewin->w -
ewin->border->
border.right);
ewin->
border->border.
right);
}
}
ewin->w = rightborderwidth + leftborderwidth;
@ -2620,8 +2621,9 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
bottomborderwidth)
bottomborderwidth =
(ewin->bits[i].y + ewin->bits[i].h) - (ewin->h -
ewin->border->
border.bottom);
ewin->
border->border.
bottom);
}
}
ewin->h = bottomborderwidth + topborderwidth;

View File

@ -1081,8 +1081,8 @@ DialogRealizeItem(Dialog * d, DItem * di)
ImlibImage *im;
im =
ELoadImage(di->item.slider.ic_border->norm.
normal->im_file);
ELoadImage(di->item.slider.ic_border->norm.normal->
im_file);
if (im)
{
di->item.slider.border_orig_w = im->rgb_width;
@ -1356,25 +1356,23 @@ DialogRealizeItem(Dialog * d, DItem * di)
dii->item.check_button.check_win,
dii->x, dii->y +
((dii->h -
dii->item.
check_button.check_orig_h) /
2),
dii->item.
check_button.check_orig_w,
dii->item.
check_button.check_orig_h);
dii->item.check_button.
check_orig_h) / 2),
dii->item.check_button.
check_orig_w,
dii->item.check_button.
check_orig_h);
if (dii->type == DITEM_RADIOBUTTON)
EMoveResizeWindow(disp,
dii->item.radio_button.radio_win,
dii->x, dii->y +
((dii->h -
dii->item.
radio_button.radio_orig_h) /
2),
dii->item.
radio_button.radio_orig_w,
dii->item.
radio_button.radio_orig_h);
dii->item.radio_button.
radio_orig_h) / 2),
dii->item.radio_button.
radio_orig_w,
dii->item.radio_button.
radio_orig_h);
if (dii->type == DITEM_AREA)
{
dii->item.area.w = dii->w -
@ -1884,8 +1882,7 @@ DialogItemAreaSetSize(DItem * di, int w, int h)
di->item.area.h = h;
}
Window
DialogItemAreaGetWindow(DItem * di)
Window DialogItemAreaGetWindow(DItem * di)
{
return di->item.area.area_win;
}

View File

@ -494,7 +494,8 @@ HandleMotion(XEvent * ev)
(gwins
[i]->reqx,
gwins[i]->x,
mode.edge_snap_dist)))))))
mode.
edge_snap_dist)))))))
{
jumpx = 1;
ndx = gwins[i]->reqx - gwins[i]->x + dx;
@ -517,7 +518,8 @@ HandleMotion(XEvent * ev)
(gwins
[i]->reqy,
gwins[i]->y,
mode.edge_snap_dist)))))))
mode.
edge_snap_dist)))))))
{
jumpy = 1;
ndy = gwins[i]->reqy - gwins[i]->y + dy;
@ -980,8 +982,8 @@ HandleMotion(XEvent * ev)
{
di->item.slider.wanted_val += dy;
di->item.slider.val = di->item.slider.lower +
((((di->item.
slider.base_h - di->item.slider.knob_h -
((((di->
item.slider.base_h - di->item.slider.knob_h -
di->item.slider.wanted_val) *
(di->item.slider.upper -
di->item.slider.lower)) /
@ -2507,13 +2509,13 @@ HandleMouseUp(XEvent * ev)
HideEwin(gwins[i]);
MoveEwin(gwins[i], gwin_px[i] +
((desks.desk
[gwins[i]->
desktop].current_area_x) -
[gwins[i]->desktop].
current_area_x) -
p->hi_ewin->area_x) * root.w,
gwin_py[i] +
((desks.desk
[gwins[i]->
desktop].current_area_y) -
((desks.
desk[gwins[i]->desktop].
current_area_y) -
p->hi_ewin->area_y) * root.h);
if (was_shaded != gwins[i]->shaded)
InstantShadeEwin(gwins[i]);

View File

@ -263,8 +263,7 @@ cp(char *s, char *ss)
EDBUG_RETURN_;
}
time_t
moddate(char *s)
time_t moddate(char *s)
{
struct stat st;

View File

@ -1745,8 +1745,8 @@ IPC_ImageClass(char *params, Client * c)
if (iclass->norm.normal->real_file)
im =
Imlib_load_image(id,
iclass->norm.
normal->real_file);
iclass->norm.normal->
real_file);
if (im)
{
Esnprintf(buf, sizeof(buf),

View File

@ -275,7 +275,8 @@ ShowMenu(Menu * m, char noshow)
int x, y, wx = 0, wy = 0; /* wx, wy added to stop menus
*
* * from appearing offscreen */
* *
* * * from appearing offscreen */
unsigned int w, h, mw, mh;
EDBUG(5, "ShowMenu");

View File

@ -126,8 +126,7 @@ GetNetText(char *URL)
}
time_t
GetNetFileDate(char *URL)
time_t GetNetFileDate(char *URL)
{
#ifdef AUTOUPGRADE

View File

@ -37,8 +37,7 @@ static Window sc_window = 0;
static Atom sc_atom = 0;
static ImlibData *imd = NULL;
Window
SC_GetDestWin(void)
Window SC_GetDestWin(void)
{
return 0;
}

View File

@ -751,7 +751,8 @@ SetupEnv()
return;
}
Window MakeExtInitWin(void)
Window
MakeExtInitWin(void)
{
Display *d2;
Window win;

View File

@ -679,8 +679,8 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->im),
x, y);
@ -702,12 +702,11 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -723,12 +722,11 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -744,12 +742,11 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -765,12 +762,11 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -786,12 +782,11 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -811,17 +806,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -835,17 +829,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -859,17 +852,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -883,17 +875,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -907,17 +898,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -931,17 +921,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -955,17 +944,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -979,17 +967,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->
im->rgb_height);
ic->norm.normal->im->
rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}

15
src/x.c
View File

@ -40,8 +40,7 @@ EFreePixmap(Display * display, Pixmap pixmap)
XFreePixmap(display, pixmap);
}
Window
ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
Window ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
{
EXID *xid;
Window win;
@ -587,8 +586,7 @@ DelXID(Window win)
}
}
Window
ECreateEventWindow(Window parent, int x, int y, int w, int h)
Window ECreateEventWindow(Window parent, int x, int y, int w, int h)
{
Window win;
XSetWindowAttributes attr;
@ -604,8 +602,7 @@ ECreateEventWindow(Window parent, int x, int y, int w, int h)
* create a window which will accept the keyboard focus when no other
* windows have it
*/
Window
ECreateFocusWindow(Window parent, int x, int y, int w, int h)
Window ECreateFocusWindow(Window parent, int x, int y, int w, int h)
{
Window win;
XSetWindowAttributes attr;
@ -739,8 +736,7 @@ WinExists(Window win)
EDBUG_RETURN(0);
}
Window
WindowAtXY_0(Window base, int bx, int by, int x, int y)
Window WindowAtXY_0(Window base, int bx, int by, int x, int y)
{
Window *list = NULL;
XWindowAttributes att;
@ -787,8 +783,7 @@ WindowAtXY_0(Window base, int bx, int by, int x, int y)
EDBUG_RETURN(base);
}
Window
WindowAtXY(int x, int y)
Window WindowAtXY(int x, int y)
{
Window *list = NULL;
Window child = 0, parent_win = 0, root_win = 0;