Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework FvwmPager to move windows easier #536

Merged
merged 6 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions modules/FvwmPager/FvwmPager.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ char *WindowHiFore = NULL;
char *WindowLabelFormat = NULL;

unsigned int WindowBorderWidth = DEFAULT_PAGER_WINDOW_BORDER_WIDTH;
unsigned int MinSize = 2 * DEFAULT_PAGER_WINDOW_BORDER_WIDTH + 1;
unsigned int MinSize = 2 * DEFAULT_PAGER_WINDOW_BORDER_WIDTH + 5;
Bool WindowBorders3d = False;

Bool UseSkipList = False;
Expand All @@ -114,8 +114,8 @@ int BalloonBorderWidth = 1;
int BalloonYOffset = 3;
Window BalloonView = None;

int window_w=0, window_h=0, window_x=0, window_y=0;
int icon_x=-10000, icon_y=-10000, icon_w=0, icon_h=0;
rectangle pwindow = {0, 0, 0, 0};
rectangle icon = {-10000, -10000, 0, 0};
int usposition = 0,uselabel = 1;
int xneg = 0, yneg = 0;
int icon_xneg = 0, icon_yneg = 0;
Expand Down Expand Up @@ -404,12 +404,12 @@ int main(int argc, char **argv)
if (is_transient)
{
if (FQueryPointer(
dpy, Scr.Root, &JunkRoot, &JunkChild, &window_x, &window_y, &JunkX,
dpy, Scr.Root, &JunkRoot, &JunkChild, &pwindow.x, &pwindow.y, &JunkX,
&JunkY, &JunkMask) == False)
{
/* pointer is on a different screen */
window_x = 0;
window_y = 0;
pwindow.x = 0;
pwindow.y = 0;
}
usposition = 1;
xneg = 0;
Expand Down Expand Up @@ -522,7 +522,7 @@ void Loop(int *fd)
int x,y;

if(XGetGeometry(dpy,Scr.Pager_w,&root,&x,&y,
(unsigned *)&window_w,(unsigned *)&window_h,
(unsigned *)&pwindow.width,(unsigned *)&pwindow.height,
&border_width,&depth)==0)
{
/* does not return */
Expand Down Expand Up @@ -1956,25 +1956,25 @@ void ParseOptions(void)
}
else if (StrEquals(resource, "Geometry"))
{
window_w = 0;
window_h = 0;
window_x = 0;
window_y = 0;
pwindow.width = 0;
pwindow.height = 0;
pwindow.x = 0;
pwindow.y = 0;
xneg = 0;
yneg = 0;
usposition = 0;
flags = FScreenParseGeometry(arg1,&g_x,&g_y,&width,&height);
if (flags & WidthValue)
{
window_w = width;
pwindow.width = width;
}
if (flags & HeightValue)
{
window_h = height;
pwindow.height = height;
}
if (flags & XValue)
{
window_x = g_x;
pwindow.x = g_x;
usposition = 1;
if (flags & XNegative)
{
Expand All @@ -1983,7 +1983,7 @@ void ParseOptions(void)
}
if (flags & YValue)
{
window_y = g_y;
pwindow.y = g_y;
usposition = 1;
if (flags & YNegative)
{
Expand All @@ -1993,28 +1993,28 @@ void ParseOptions(void)
}
else if (StrEquals(resource, "IconGeometry"))
{
icon_w = 0;
icon_h = 0;
icon_x = -10000;
icon_y = -10000;
icon.width = 0;
icon.height = 0;
icon.x = -10000;
icon.y = -10000;
icon_xneg = 0;
icon_yneg = 0;
flags = FScreenParseGeometry(arg1,&g_x,&g_y,&width,&height);
if (flags & WidthValue)
icon_w = width;
icon.width = width;
if (flags & HeightValue)
icon_h = height;
icon.height = height;
if (flags & XValue)
{
icon_x = g_x;
icon.x = g_x;
if (flags & XNegative)
{
icon_xneg = 1;
}
}
if (flags & YValue)
{
icon_y = g_y;
icon.y = g_y;
if (flags & YNegative)
{
icon_yneg = 1;
Expand Down Expand Up @@ -2292,7 +2292,7 @@ void ParseOptions(void)
else if (StrEquals(resource, "WindowBorderWidth"))
{
sscanf(arg1, "%d", &WindowBorderWidth);
MinSize = 2 * WindowBorderWidth + 1;
MinSize = 2 * WindowBorderWidth + 5;
}
else if (StrEquals(resource, "Window3dBorders"))
{
Expand Down
3 changes: 1 addition & 2 deletions modules/FvwmPager/FvwmPager.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ void MoveResizePagerView(PagerWindow *t, Bool do_force_redraw);
void ChangeDeskForWindow(PagerWindow *t,long newdesk);
void MoveStickyWindow(Bool is_new_page, Bool is_new_desk);
void Hilight(PagerWindow *, int);
void Scroll(int window_w, int window_h, int x, int y, int Desk,
Bool do_scroll_icon);
void Scroll(int x, int y, int Desk, Bool do_scroll_icon);
void MoveWindow(XEvent *Event);
void BorderWindow(PagerWindow *t);
void BorderIconWindow(PagerWindow *t);
Expand Down
Loading