On Thu, 04 Apr 2013, BALATON Zoltan escribió:
> On Thu, 4 Apr 2013, Daniel Déchelotte wrote:
> >>Before this patch, if the Dock/Clip is in the screen bottom, and clip
> >>to
> >>show the menu in the bottom area, the menu is hidden outside the
> >>screen.
> >
> >Sorry for chiming in without fully understanding the bug and the
> >fix, but IIUC, wMenuMapAt() is given the "preferred" (x,y)
> >coordinates where to display the menu. Then it is responsible for
> >overriding them if the menu would appear off-screen and if asked
> >by the user's preferences. IOW, the logic of "we are too close to
> >the border, let's move a bit" should happen in wMenuMapAt, and
> >only if the appropriate preference is set. No?
>
> As someone who uses the "appropriate preference" (Scroll off screen
> menus is on) tried it and seems that it works all right for app
> icons at the bottom of the screen but for docked app icons the menus
> are indeed inaccessible if the pointer is within two pixels of the
> bottom of the screen. These two pixels seem to also exist when menus
> are displayed elsewhere: App icon menus are open with the pointer
> touching their top (moving down one pixel selects the first menu
> item) while for docked/clipped appicons there's a two pixel gap
> between the pointer and the menu (only the third pixel down will
> select the menu). This might be something to do with this bug but I
> don't know where does it come from.
>
> Regards,
> BALATON Zoltan
The main problem is that appicon has their own code to calculate the x_pos and
the y_pos to show the menu. docks has their own code to to the same,...
appicon.c:openApplicationMenu(...)
------------8<------------------
x -= menu->frame->core->width / 2;
if (x + menu->frame->core->width > scr->scr_width)
x = scr->scr_width - menu->frame->core->width;
if (x < 0)
x = 0;
/* set client data */
for (i = 0; i < menu->entry_no; i++)
menu->entries[i]->clientdata = wapp;
wMenuMapAt(menu, x, y, False);
------------8<------------------
dock.c:
------------8<------------------
if (dock->type == WM_CLIP) {
/*x_pos = event->xbutton.x_root+2; */
x_pos = event->xbutton.x_root - dock->menu->frame->core->width
/ 2 - 1;
if (x_pos < 0) {
x_pos = 0;
} else if (x_pos + dock->menu->frame->core->width >
scr->scr_width - 2) {
x_pos = scr->scr_width - dock->menu->frame->core->width
- 4;
}
} else {
x_pos = dock->on_right_side ? scr->scr_width -
dock->menu->frame->core->width - 3 : 0;
}
wMenuMapAt(dock->menu, x_pos, event->xbutton.y_root + 2, False);
------------8<------------------
I wrote a patch here to change the WM_DOCK behavior, why the x_pos is 0 or the
screen width minus the dock size?? We can use the clicked point too. Anyway,
IMO, we should use the same functions to show the menu, for docks, appicons,...
kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].