awesome-shifty icon indicating copy to clipboard operation
awesome-shifty copied to clipboard

No sane default position for floating windows

Open kcburge opened this issue 11 years ago • 3 comments

If you have two screens, new windows in floating layout can appear offscreen and inaccessible.

The below patch on 3.5 branch fixed it for me (borrowed from awesome's original rc.lua).

diff --git a/init.lua b/init.lua
index 8e7a760..631e7d9 100644
--- a/init.lua
+++ b/init.lua
@@ -756,6 +756,14 @@ function match(c, startup)
     awful.placement.no_offscreen(c)
   end

+  if not startup then
+     -- Put windows in a smart way, only if they does not set an initial position.
+     if not c.size_hints.user_position and not c.size_hints.program_position then
+        awful.placement.no_overlap(c)
+        awful.placement.no_offscreen(c)
+     end
+  end
+
   local sel = awful.tag.selectedlist(target_screen)
   if not target_tag_names or #target_tag_names == 0 then
     -- if not matched to some names try putting

kcburge avatar Jun 07 '13 11:06 kcburge

@kcburge It's tough to tell what the patch was intended to look like, as both "+" and "-" show up as bullets when pasted raw. Perhaps you could wrap the diff in <pre> tags, so that people can see the actual diff.

mpalmi avatar Jun 10 '15 16:06 mpalmi

FWIW, I just confirmed that this patch is still in my branch off of shifty, which has been modified to work with newer awesome versions.

kcburge avatar Jun 10 '15 16:06 kcburge

Awesome. Thanks for the quick response!

mpalmi avatar Jun 10 '15 16:06 mpalmi