mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 21:38:00 +01:00
wGetRectForHead moved to where used
The definition and call for wGetRectForHead is moved inside the if block where is used. This code adds a WScreen pointer to make the line shorter. If menu->frame is NULL, then was NULL before this patch, so this code doesn't include an error about this. This patch will used with next patch to move the code inside the block to an specific function.
This commit is contained in:
committed by
Carlos R. Mafra
parent
b9e8bbbdc7
commit
6fe23037ef
@@ -1062,15 +1062,16 @@ static int keyboardMenu(WMenu * menu)
|
|||||||
|
|
||||||
void wMenuMapAt(WMenu * menu, int x, int y, int keyboard)
|
void wMenuMapAt(WMenu * menu, int x, int y, int keyboard)
|
||||||
{
|
{
|
||||||
WMRect rect = wGetRectForHead(menu->frame->screen_ptr,
|
|
||||||
wGetHeadForPointerLocation(menu->frame->screen_ptr));
|
|
||||||
|
|
||||||
if (!menu->flags.realized) {
|
if (!menu->flags.realized) {
|
||||||
menu->flags.realized = 1;
|
menu->flags.realized = 1;
|
||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!menu->flags.mapped) {
|
if (!menu->flags.mapped) {
|
||||||
if (wPreferences.wrap_menus) {
|
if (wPreferences.wrap_menus) {
|
||||||
|
WScreen *scr = menu->frame->screen_ptr;
|
||||||
|
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||||
|
|
||||||
if (x < rect.pos.x)
|
if (x < rect.pos.x)
|
||||||
x = rect.pos.x;
|
x = rect.pos.x;
|
||||||
if (y < rect.pos.y)
|
if (y < rect.pos.y)
|
||||||
|
|||||||
Reference in New Issue
Block a user