mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-11 03:55:53 +01:00
Additional function for checking head
Added function for checking head of certain location. This function is used for determinig head bounduary.
This commit is contained in:
@@ -497,8 +497,8 @@ void handleMaximize(WWindow *wwin, int directions)
|
||||
p.y = 0;
|
||||
|
||||
if (p.x > 0) {
|
||||
head = wGetHeadForPoint(wwin->screen_ptr, p);
|
||||
if (head != wGetHeadForWindow(wwin)) {
|
||||
head = wGetHeadForPointOrNegative(wwin->screen_ptr, p);
|
||||
if (head != -1) {
|
||||
effective |= MAX_RIGHTHALF;
|
||||
effective |= MAX_VERTICAL;
|
||||
effective &= ~(MAX_HORIZONTAL | MAX_LEFTHALF);
|
||||
@@ -508,8 +508,8 @@ void handleMaximize(WWindow *wwin, int directions)
|
||||
} else if (requested & MAX_RIGHTHALF && current & MAX_RIGHTHALF) {
|
||||
p.x = wwin->frame_x + wwin->frame->core->width + 100;
|
||||
p.y = 0;
|
||||
head = wGetHeadForPoint(wwin->screen_ptr, p);
|
||||
if (head != wGetHeadForWindow(wwin)) {
|
||||
head = wGetHeadForPointOrNegative(wwin->screen_ptr, p);
|
||||
if (head != -1) {
|
||||
effective |= MAX_LEFTHALF;
|
||||
effective |= MAX_VERTICAL;
|
||||
effective &= ~(MAX_HORIZONTAL | MAX_RIGHTHALF);
|
||||
|
||||
@@ -236,7 +236,7 @@ int wGetHeadForWindow(WWindow * wwin)
|
||||
return wGetHeadForRect(wwin->screen_ptr, rect);
|
||||
}
|
||||
|
||||
int wGetHeadForPoint(WScreen * scr, WMPoint point)
|
||||
int wGetHeadForPointOrNegative(WScreen * scr, WMPoint point)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -247,7 +247,17 @@ int wGetHeadForPoint(WScreen * scr, WMPoint point)
|
||||
(unsigned)(point.y - rect->pos.y) < rect->size.height)
|
||||
return i;
|
||||
}
|
||||
return scr->xine_info.primary_head;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int wGetHeadForPoint(WScreen * scr, WMPoint point)
|
||||
{
|
||||
int head = wGetHeadForPointOrNegative(scr, point);
|
||||
|
||||
if (head < 0)
|
||||
return scr->xine_info.primary_head;
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
int wGetHeadForPointerLocation(WScreen * scr)
|
||||
|
||||
@@ -41,6 +41,8 @@ int wGetHeadForRect(WScreen *scr, WMRect rect);
|
||||
|
||||
int wGetHeadForWindow(WWindow *wwin);
|
||||
|
||||
int wGetHeadForPointOrNegative(WScreen * scr, WMPoint point);
|
||||
|
||||
int wGetHeadForPoint(WScreen *scr, WMPoint point);
|
||||
|
||||
int wGetHeadForPointerLocation(WScreen *scr);
|
||||
|
||||
Reference in New Issue
Block a user