Re: [PATCH v3] NEWS: Add note about window snapping.
On Monday 2015-06-22 10:02:56 Doug Torrance wrote: > On 06/21/2015 03:37 AM, Josip Deanovic wrote: > > I have just looked at the code and I think it could be done. > > > > This is what I did and it works fine. I have used 10px but it might > > be increased (lower than 10px wouldn't look good). > > > > It makes corner snapping much easier and it looks more like something > > people might be used to while working with other systems. > > I've adapted your patch a bit to make both the edge and corner detect > distances configurable. > > Carlos, the wireless I'm on currently isn't allowing me smtp access to > use git send-email. I've attached the patch -- I hope that's ok. > > Doug Thank you. -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On Mon, 22 Jun 2015 at 10:02:56 -0500, Doug Torrance wrote: > On 06/21/2015 03:37 AM, Josip Deanovic wrote: > > > I have just looked at the code and I think it could be done. > > > > This is what I did and it works fine. I have used 10px but it might > > be increased (lower than 10px wouldn't look good). > > > > It makes corner snapping much easier and it looks more like something > > people might be used to while working with other systems. > > I've adapted your patch a bit to make both the edge and corner detect > distances configurable. > > Carlos, the wireless I'm on currently isn't allowing me smtp access to use git > send-email. I've attached the patch -- I hope that's ok. Thank you, Doug! The patch should be in the repo now. Fortunately the airport wifi in Sao Paulo doesn't have any restrictions :-) > > Doug > From b836816651d1c2cb3c9435d45e03e41baccc665a Mon Sep 17 00:00:00 2001 > From: Doug Torrance > Date: Mon, 22 Jun 2015 09:50:51 -0500 > Subject: [PATCH] wmaker: Allow configuration of window snapping detect > distances. > > This patch introduces two new configuration values, SnapEdgeDetect and > SnapCornerDetect, which users can set to change the distance from an edge > or corner at which window snapping will begin. The defaults are 1 and 10, > respectively. > > Suggested-by: Josip Deanovic > --- > NEWS | 5 + > src/WindowMaker.h | 2 ++ > src/defaults.c| 4 > src/moveres.c | 33 +++-- > 4 files changed, 30 insertions(+), 14 deletions(-) > > diff --git a/NEWS b/NEWS > index fb96dbb..d60603c 100644 > --- a/NEWS > +++ b/NEWS > @@ -17,6 +17,11 @@ Note that if "Switch workspaces while dragging windows" is > selected under > ~/GNUstep/Defaults/WindowMaker, then you may only snap a window to the top or > bottom of the screen. > > +You may set the distance (in pixels) from the edge or corner of the screen at > +which a window will begin snapping using "SnapEdgeDetect" and > "SnapCornerDetect" > +in ~/GNUstep/Defaults/WindowMaker. (The defaults are 1 pixel and 10 pixels, > +respectively). > + > > Dragging maximized windows > -- > diff --git a/src/WindowMaker.h b/src/WindowMaker.h > index 37e3fc0..99751ff 100644 > --- a/src/WindowMaker.h > +++ b/src/WindowMaker.h > @@ -360,6 +360,8 @@ extern struct WPreferences { > char no_animations;/* enable/disable animations */ > char no_autowrap; /* wrap workspace when window is > moved to the edge */ > char window_snapping; /* enable window snapping */ > + int snap_edge_detect; /* how far from edge to begin snap */ > + int snap_corner_detect;/* how far from corner to begin snap > */ > char drag_maximized_window;/* behavior when a maximized window > is dragged */ > > char highlight_active_app; /* show the focused app by > highlighting its icon */ > diff --git a/src/defaults.c b/src/defaults.c > index c5a94c6..6f9edfd 100644 > --- a/src/defaults.c > +++ b/src/defaults.c > @@ -474,6 +474,10 @@ WDefaultEntry optionList[] = { > &wPreferences.no_autowrap, getBool, NULL, NULL, NULL}, > {"WindowSnapping", "NO", NULL, > &wPreferences.window_snapping, getBool, NULL, NULL, NULL}, > + {"SnapEdgeDetect", "1", NULL, > + &wPreferences.snap_edge_detect, getInt, NULL, NULL, NULL}, > + {"SnapCornerDetect", "10", NULL, > + &wPreferences.snap_corner_detect, getInt, NULL, NULL, NULL}, > {"DragMaximizedWindow", "Move", seDragMaximizedWindow, > &wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL}, > {"HighlightActiveApp", "YES", NULL, > diff --git a/src/moveres.c b/src/moveres.c > index cded064..e8883c8 100644 > --- a/src/moveres.c > +++ b/src/moveres.c > @@ -1240,23 +1240,28 @@ static void draw_snap_frame(WWindow *wwin, int > direction) > > static int get_snap_direction(WScreen *scr, int x, int y) > { > - if (x < 1) { > - if (y < 1) > - return SNAP_TOPLEFT; > - if (y > scr->scr_height - 2) > - return SNAP_BOTTOMLEFT; > + int edge, corner; > + > + edge = wPreferences.snap_edge_detect; > + corner = wPreferences.snap_corner_detect; > + > + if (x < corner && y < corner) > + return SNAP_TOPLEFT; > + if (x < corner && y >= scr->scr_height - corner) > + return SNAP_BOTTOMLEFT; > + if (x < edge) > return SNAP_LEFT; > - } > - if (x > scr->scr_width - 2) { > - if (y < 1) > - return SNAP_TOPRIGHT; > - if (y > scr->scr_height - 2) > - return SNAP_BOTTOMRIGHT; > + > + if (x >= scr->scr_width - corner && y < corner) > + return SNAP_TOPRIGHT; > + if (x >= scr->scr_width - corner && y >= scr->scr_height - corner) > + return SNAP_BOTTOMRIGHT; > +
Re: [PATCH v3] NEWS: Add note about window snapping.
On 06/21/2015 03:37 AM, Josip Deanovic wrote: > I have just looked at the code and I think it could be done. > > This is what I did and it works fine. I have used 10px but it might > be increased (lower than 10px wouldn't look good). > > It makes corner snapping much easier and it looks more like something > people might be used to while working with other systems. I've adapted your patch a bit to make both the edge and corner detect distances configurable. Carlos, the wireless I'm on currently isn't allowing me smtp access to use git send-email. I've attached the patch -- I hope that's ok. Doug From b836816651d1c2cb3c9435d45e03e41baccc665a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 22 Jun 2015 09:50:51 -0500 Subject: [PATCH] wmaker: Allow configuration of window snapping detect distances. This patch introduces two new configuration values, SnapEdgeDetect and SnapCornerDetect, which users can set to change the distance from an edge or corner at which window snapping will begin. The defaults are 1 and 10, respectively. Suggested-by: Josip Deanovic --- NEWS | 5 + src/WindowMaker.h | 2 ++ src/defaults.c| 4 src/moveres.c | 33 +++-- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index fb96dbb..d60603c 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,11 @@ Note that if "Switch workspaces while dragging windows" is selected under ~/GNUstep/Defaults/WindowMaker, then you may only snap a window to the top or bottom of the screen. +You may set the distance (in pixels) from the edge or corner of the screen at +which a window will begin snapping using "SnapEdgeDetect" and "SnapCornerDetect" +in ~/GNUstep/Defaults/WindowMaker. (The defaults are 1 pixel and 10 pixels, +respectively). + Dragging maximized windows -- diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 37e3fc0..99751ff 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -360,6 +360,8 @@ extern struct WPreferences { char no_animations;/* enable/disable animations */ char no_autowrap; /* wrap workspace when window is moved to the edge */ char window_snapping; /* enable window snapping */ + int snap_edge_detect; /* how far from edge to begin snap */ + int snap_corner_detect;/* how far from corner to begin snap */ char drag_maximized_window;/* behavior when a maximized window is dragged */ char highlight_active_app; /* show the focused app by highlighting its icon */ diff --git a/src/defaults.c b/src/defaults.c index c5a94c6..6f9edfd 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -474,6 +474,10 @@ WDefaultEntry optionList[] = { &wPreferences.no_autowrap, getBool, NULL, NULL, NULL}, {"WindowSnapping", "NO", NULL, &wPreferences.window_snapping, getBool, NULL, NULL, NULL}, + {"SnapEdgeDetect", "1", NULL, + &wPreferences.snap_edge_detect, getInt, NULL, NULL, NULL}, + {"SnapCornerDetect", "10", NULL, + &wPreferences.snap_corner_detect, getInt, NULL, NULL, NULL}, {"DragMaximizedWindow", "Move", seDragMaximizedWindow, &wPreferences.drag_maximized_window, getEnum, NULL, NULL, NULL}, {"HighlightActiveApp", "YES", NULL, diff --git a/src/moveres.c b/src/moveres.c index cded064..e8883c8 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -1240,23 +1240,28 @@ static void draw_snap_frame(WWindow *wwin, int direction) static int get_snap_direction(WScreen *scr, int x, int y) { - if (x < 1) { - if (y < 1) - return SNAP_TOPLEFT; - if (y > scr->scr_height - 2) - return SNAP_BOTTOMLEFT; + int edge, corner; + + edge = wPreferences.snap_edge_detect; + corner = wPreferences.snap_corner_detect; + + if (x < corner && y < corner) + return SNAP_TOPLEFT; + if (x < corner && y >= scr->scr_height - corner) + return SNAP_BOTTOMLEFT; + if (x < edge) return SNAP_LEFT; - } - if (x > scr->scr_width - 2) { - if (y < 1) - return SNAP_TOPRIGHT; - if (y > scr->scr_height - 2) - return SNAP_BOTTOMRIGHT; + + if (x >= scr->scr_width - corner && y < corner) + return SNAP_TOPRIGHT; + if (x >= scr->scr_width - corner && y >= scr->scr_height - corner) + return SNAP_BOTTOMRIGHT; + if (x >= scr->scr_width - edge) return SNAP_RIGHT; - } - if (y < 1) + + if (y < edge) return SNAP_TOP; - if (y > scr->scr_height - 2) + if (y >= scr->scr_height - edge) return SNAP_BOTTOM; return SNAP_NONE; } -- 2.1.4
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoting message written on Sunday 2015-06-21 09:39:18: > I didn't thoroughly look at the code so I'll just ask... > In case when workspace linking is turned off, is it possible to > make a bit borders/area in which window would snap into a corner > without changing some other Windowmaker code? > > While testing the feature I have noticed that it is a bit tricky > to pick a corner. You almost need to pinpoint it and you need to > keep your cursor steady while releasing the button. Otherwise it > could chose to snap to horizontal or vertical border. I have just looked at the code and I think it could be done. This is what I did and it works fine. I have used 10px but it might be increased (lower than 10px wouldn't look good). It makes corner snapping much easier and it looks more like something people might be used to while working with other systems. --- wmaker-crm.next/src/moveres.c 2015-06-21 10:32:38.0 +0200 +++ wmaker-crm.next.patched/src/moveres.c 2015-06-21 10:27:50.0 +0200 @@ -1240,20 +1240,20 @@ static int get_snap_direction(WScreen *scr, int x, int y) { - if (x < 1) { - if (y < 1) - return SNAP_TOPLEFT; - if (y > scr->scr_height - 2) - return SNAP_BOTTOMLEFT; +if (x < 10 && y < 10) + return SNAP_TOPLEFT; +if (x < 10 && y > scr->scr_height - 10) + return SNAP_BOTTOMLEFT; + if (x < 1) return SNAP_LEFT; - } - if (x > scr->scr_width - 2) { - if (y < 1) - return SNAP_TOPRIGHT; - if (y > scr->scr_height - 2) - return SNAP_BOTTOMRIGHT; + + if (x > scr->scr_width - 10 && y < 10) + return SNAP_TOPRIGHT; +if (x > scr->scr_width - 10 && y > scr->scr_height - 10) +return SNAP_BOTTOMRIGHT; + if (x > scr->scr_width - 2) return SNAP_RIGHT; - } + if (y < 1) return SNAP_TOP; if (y > scr->scr_height - 2) -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoting message written on Saturday 2015-06-20 22:49:51: > On 06/20/2015 05:11 PM, Josip Deanovic wrote: > > I have just applied the patch and tested it and something is not > > right. > > > > Without workspace linking the feature is still working as usual. > > > > With workspace linking enabled I get the window frame created UP/DOWN, > > depending on the window position but if I decide to stop the snapping > > action (move the window from the upper/lower border) the window frame > > would stay and when I release the window it would snap to the border > > and change its size. > > > > So once the window gets near the upper/lower border and its new frame > > gets drawn, the only thing I can do is to move the window to the > > opposite border where window would act just the same. > > I think I've fixed this. I've just sent a revised patch. > > Doug I have just tested it. I have also tested it with and without workspace linking and in combination with the feature turned on/off. Everything works as expected it should be safe to apply the patch. I didn't thoroughly look at the code so I'll just ask... In case when workspace linking is turned off, is it possible to make a bit borders/area in which window would snap into a corner without changing some other Windowmaker code? While testing the feature I have noticed that it is a bit tricky to pick a corner. You almost need to pinpoint it and you need to keep your cursor steady while releasing the button. Otherwise it could chose to snap to horizontal or vertical border. -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 06/20/2015 05:11 PM, Josip Deanovic wrote: I have just applied the patch and tested it and something is not right. Without workspace linking the feature is still working as usual. With workspace linking enabled I get the window frame created UP/DOWN, depending on the window position but if I decide to stop the snapping action (move the window from the upper/lower border) the window frame would stay and when I release the window it would snap to the border and change its size. So once the window gets near the upper/lower border and its new frame gets drawn, the only thing I can do is to move the window to the opposite border where window would act just the same. I think I've fixed this. I've just sent a revised patch. Doug -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 06/20/2015 05:11 PM, Josip Deanovic wrote: I have just applied the patch and tested it and something is not right. Without workspace linking the feature is still working as usual. With workspace linking enabled I get the window frame created UP/DOWN, depending on the window position but if I decide to stop the snapping action (move the window from the upper/lower border) the window frame would stay and when I release the window it would snap to the border and change its size. So once the window gets near the upper/lower border and its new frame gets drawn, the only thing I can do is to move the window to the opposite border where window would act just the same. Oops, must have tested it too quickly. I'll give it another shot and submit a new version soon. Doug -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoting message written on Saturday 2015-06-20 12:35:33: > On 06/20/2015 03:41 AM, Josip Deanovic wrote: > > Doug, would it be to hard to not completely disable the feature in > > case > > DontLinkWorkspaces is set to "NO" but to disable just the left/right > > and corner snapping instead? > > > > That way someone who is using workspace linking feature could still > > snap a window top/bottom which is still more than nothing (actually I > > feel I would really like that feature while still being able to use > > workspace linking). > > Thanks for the suggestion! > > I just submitted a patch with this change. > > Doug I have just applied the patch and tested it and something is not right. Without workspace linking the feature is still working as usual. With workspace linking enabled I get the window frame created UP/DOWN, depending on the window position but if I decide to stop the snapping action (move the window from the upper/lower border) the window frame would stay and when I release the window it would snap to the border and change its size. So once the window gets near the upper/lower border and its new frame gets drawn, the only thing I can do is to move the window to the opposite border where window would act just the same. -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoting message written on Saturday 2015-06-20 12:35:33: > On 06/20/2015 03:41 AM, Josip Deanovic wrote: > > Doug, would it be to hard to not completely disable the feature in > > case > > DontLinkWorkspaces is set to "NO" but to disable just the left/right > > and corner snapping instead? > > > > That way someone who is using workspace linking feature could still > > snap a window top/bottom which is still more than nothing (actually I > > feel I would really like that feature while still being able to use > > workspace linking). > > Thanks for the suggestion! > > I just submitted a patch with this change. > > Doug Thank you very much. I'll test it as soon as I get some time. -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 06/20/2015 03:41 AM, Josip Deanovic wrote: Doug, would it be to hard to not completely disable the feature in case DontLinkWorkspaces is set to "NO" but to disable just the left/right and corner snapping instead? That way someone who is using workspace linking feature could still snap a window top/bottom which is still more than nothing (actually I feel I would really like that feature while still being able to use workspace linking). Thanks for the suggestion! I just submitted a patch with this change. Doug -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoting message written on Monday 2014-09-22 14:29:36: > Hi Doug, > > Great Feature ! > > Just one comment which I think that it can be improved: > > Apparently right now it just does windo snapping in the right/left > sides. It would be great if top/bottom maximization could be done too. > In particular, since my current monitor is huge, I would also love > having more options: topLeft, topRight, bottomLeft, bottomRight :) But > at least bottom/top I think that are important. I am a bit late but maybe not too late :-) Really nice feature. Doug, would it be to hard to not completely disable the feature in case DontLinkWorkspaces is set to "NO" but to disable just the left/right and corner snapping instead? That way someone who is using workspace linking feature could still snap a window top/bottom which is still more than nothing (actually I feel I would really like that feature while still being able to use workspace linking). Regards -- Josip Deanovic -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 09/22/2014 12:29 PM, Haroldo Gambini Santos wrote: > Hi Doug, > > Great Feature ! > > Just one comment which I think that it can be improved: > > Apparently right now it just does windo snapping in the right/left > sides. It would be great if top/bottom maximization could be done > too. In particular, since my current monitor is huge, I would also > love having more options: topLeft, topRight, bottomLeft, bottomRight > :) But at least bottom/top I think that are important. > > Cheers > > Haroldo Thanks! Those shouldn't be too hard too implement. I'll submit a new version soon. -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Hi Doug, Great Feature ! Just one comment which I think that it can be improved: Apparently right now it just does windo snapping in the right/left sides. It would be great if top/bottom maximization could be done too. In particular, since my current monitor is huge, I would also love having more options: topLeft, topRight, bottomLeft, bottomRight :) But at least bottom/top I think that are important. Cheers Haroldo On 21-09-2014 23:02, Doug Torrance wrote: --- NEWS | 15 +++ 1 file changed, 15 insertions(+) diff --git a/NEWS b/NEWS index 35319b0..ce8b86e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,21 @@ NEWS for veteran Window Maker users --- +-- 0.95.7 + +Window snapping +--- + +You can now "snap" a window, i.e., maximize it to the left or right half of the +screen, by dragging it to that side. It is enabled by setting +"WindowSnapping = YES" in ~/GNUstep/Defaults/WindowMaker or selecting "Enable +window snapping" under "Expert User Preferences" in WPrefs.app. + +Note that window snapping is automatically disabled if "Switch workspaces while +dragging windows" is selected under "Workspace Preferences" in WPrefs.app, or +if "DontLinkWorkspaces = NO" in ~/GNUstep/Defaults/WindowMaker, as this feature +also involves dragging a window to one side of the screen. + --- 0.95.6 More image format supported -- == Haroldo Gambini Santos D.Sc, Computer Science Universidade Federal de Ouro Preto http://www.decom.ufop.br/haroldo/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 09/22/2014 10:20 AM, Iain Patterson wrote: ... Windows gives a visual hint when a window is going to snap and resize. One could argue that the hint is subtle and too slow to appear but it is there. MS developers may shoehorn their captive audience into all kinds of behaviour and get away with it. Here, not so. But if the option is named with care and kept away from the first row, why not, after all? As long as the window doesn't literally resize without warning the feature could work. That's some legalese. :) Yury -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
Quoth Yury Tarasievich, First, you get your window size changed *unexpectedly*. Who pays to attention to those "end boxes", really? Should one treat the half-visible "end boxes" as something, examining which is obligatory for the successful operation completion? Those boxes are just (useful) hints! Windows gives a visual hint when a window is going to snap and resize. One could argue that the hint is subtle and too slow to appear but it is there. As long as the window doesn't literally resize without warning the feature could work. -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 09/22/2014 08:18 AM, Torrance, Douglas wrote: On 09/22/2014 12:06 AM, Yury Tarasievich wrote: ... Snap is only the intermediate result here, triggering the final result. The size of the window isn't changed until after the move is completed. So it's even worse, on two accounts. First, you get your window size changed *unexpectedly*. Who pays to attention to those "end boxes", really? Should one treat the half-visible "end boxes" as something, examining which is obligatory for the successful operation completion? Those boxes are just (useful) hints! Second, I wouldn't want a MS-bashing session develop here, but really, their interface contributions (terminology included) *may* happen to be just silly, and replicating them in the window system which had and used correct snap for ages is ..., well, not so clever, too. :) Yury While moving the window, only a transparent frame is shown showing the future position/geometry of the window if the user chooses to complete the snap. The term is borrowed from (gulp) Windows [1]. [1] http://windows.microsoft.com/en-us/windows7/products/features/snap -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH v3] NEWS: Add note about window snapping.
On 09/22/2014 12:06 AM, Yury Tarasievich wrote: > Wait, does this change the window size when move's in progress, too? > Then it's not "snapping" at all, and the term used is very confusing. > More precisely, it's something like "half-maximise when edge is hit" > or "half-fill when edge-snapped". > Snap is only the intermediate result here, triggering the final result. The size of the window isn't changed until after the move is completed. While moving the window, only a transparent frame is shown showing the future position/geometry of the window if the user chooses to complete the snap. The term is borrowed from (gulp) Windows [1]. [1] http://windows.microsoft.com/en-us/windows7/products/features/snap
Re: [PATCH v3] NEWS: Add note about window snapping.
Wait, does this change the window size when move's in progress, too? Then it's not "snapping" at all, and the term used is very confusing. More precisely, it's something like "half-maximise when edge is hit" or "half-fill when edge-snapped". Snap is only the intermediate result here, triggering the final result. Yury On 09/22/2014 05:02 AM, Doug Torrance wrote: +You can now "snap" a window, i.e., maximize it to the left or right half of the +screen, by dragging it to that side. It is enabled by setting ... -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.