parent
f01ab0895b
commit
cd1981f079
1
src/TODO
1
src/TODO
|
@ -4,6 +4,7 @@ user: add submenu resistance / timeout for running across to a submenu
|
||||||
user: add "virtual" resistance boxes
|
user: add "virtual" resistance boxes
|
||||||
user: resistance is still in effect for iconified window
|
user: resistance is still in effect for iconified window
|
||||||
user: finer grained control on selecting icon display policy
|
user: finer grained control on selecting icon display policy
|
||||||
|
kainx: translucent and group window moves if move != opaque - fix :)
|
||||||
kainx: new tooltip stuff doesnt saccoutn for 2x extra in calculating iconbox
|
kainx: new tooltip stuff doesnt saccoutn for 2x extra in calculating iconbox
|
||||||
kainx: reduce need for tooltip text to have auto gened tooltips work
|
kainx: reduce need for tooltip text to have auto gened tooltips work
|
||||||
raster: window groups...
|
raster: window groups...
|
||||||
|
|
34
src/menus.c
34
src/menus.c
|
@ -280,7 +280,7 @@ void
|
||||||
ShowMenu(Menu * m, char noshow)
|
ShowMenu(Menu * m, char noshow)
|
||||||
{
|
{
|
||||||
EWin *ewin;
|
EWin *ewin;
|
||||||
int x, y;
|
int x, y, wx, wy; /* wx, wy added to stop menus from appearing offscreen */
|
||||||
unsigned int w, h, mw, mh;
|
unsigned int w, h, mw, mh;
|
||||||
|
|
||||||
EDBUG(5, "ShowMenu");
|
EDBUG(5, "ShowMenu");
|
||||||
|
@ -299,19 +299,43 @@ ShowMenu(Menu * m, char noshow)
|
||||||
GetWinXY(m->items[0]->win, &x, &y);
|
GetWinXY(m->items[0]->win, &x, &y);
|
||||||
GetWinWH(m->items[0]->win, &w, &h);
|
GetWinWH(m->items[0]->win, &w, &h);
|
||||||
GetWinWH(m->win, &mw, &mh);
|
GetWinWH(m->win, &mw, &mh);
|
||||||
if ((mode.x >= 0) && (mode.y >= 0))
|
|
||||||
EMoveWindow(disp, m->win, mode.x - x - (w / 2), mode.y - y - (h / 2));
|
if (mode.x - x -(w / 2) > root.w)
|
||||||
|
{
|
||||||
|
wx = 0 + (mw - w);
|
||||||
|
}
|
||||||
|
else if (mode.x + w > root.w)
|
||||||
|
{
|
||||||
|
wx = root.w - mw - (mw - w);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wx = mode.x - x -(w / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode.y + mh > root.h)
|
||||||
|
{
|
||||||
|
wy = root.h - mh;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wy = mode.y - y - (h / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((mode.x >= 0) && (mode.y >= 0))
|
||||||
|
EMoveWindow(disp, m->win, wx, wy);
|
||||||
|
|
||||||
else if ((mode.x >= 0) && (mode.y < 0))
|
else if ((mode.x >= 0) && (mode.y < 0))
|
||||||
{
|
{
|
||||||
if (((-mode.y) + (int)mh) > (int)root.h)
|
if (((-mode.y) + (int)mh) > (int)root.h)
|
||||||
mode.y = -((-mode.y) - mode.context_h - mh);
|
mode.y = -((-mode.y) - mode.context_h - mh);
|
||||||
EMoveWindow(disp, m->win, mode.x - x - (w / 2), -mode.y);
|
EMoveWindow(disp, m->win, wx, -mode.y);
|
||||||
}
|
}
|
||||||
else if ((mode.x < 0) && (mode.y >= 0))
|
else if ((mode.x < 0) && (mode.y >= 0))
|
||||||
{
|
{
|
||||||
if (((-mode.x) + (int)mw) > (int)root.w)
|
if (((-mode.x) + (int)mw) > (int)root.w)
|
||||||
mode.x = -((-mode.x) - mode.context_w - mw);
|
mode.x = -((-mode.x) - mode.context_w - mw);
|
||||||
EMoveWindow(disp, m->win, -mode.x, mode.y - y - (h / 2));
|
EMoveWindow(disp, m->win, -mode.x, wy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue