awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.36k stars 597 forks source link

awful.placement not updating workarea #1449

Open bryanalves opened 7 years ago

bryanalves commented 7 years ago

Output of awesome --version:

awesome v4.0-139-g508614df (Harder, Better, Faster, Stronger) • Compiled against Lua 5.3.3 (running with Lua 5.3) • D-Bus support: ✔ • execinfo support: ✔ • RandR 1.5 support: ✔ • LGI version: 0.9.1

How to reproduce the issue:

with the following rules

awful.rules.rules = {
  { rule = { },
    properties = {
      border_width = beautiful.border_width,
      border_color = beautiful.border_normal,
      callback = awful.client.setslave,
      focus = awful.client.focus.filter,
      keys = clientkeys,
      buttons = clientbuttons,
      screen = awful.screen.preferred,
      placement = awful.placement.no_overlap+awful.placement.no_offscreen
    }
  },

  { rule = { class = "Pidgin", role = "buddy_list" },
    properties = {
      floating = true,
      screen = 1,
      tag = "3",
      width = 250,
      callback = function (c)
          awful.placement.right(c, { attach = true, update_workarea = true })
      end
    }
  }
}

Launch pidgin, and then launch a terminal window.

Actual result:

Pidgin launches, and is aligned to the right of the screen as it should be. The terminal also loads, but is full-screen and overlaps with the pidgin window.

Expected result:

The 2 windows should appear side by side and not overlap. Subsequent new windows should stack and never overlap with pidgin. The 250 pixel area to the right should be reserved only for pidgin -- other windows shouldn't stack or overlap with it.

A couple of other maybe interesting configurations:

Manual struts

  { rule = { class = "Pidgin", role = "buddy_list" },
    properties = {
      floating = true,
      screen = 1,
      tag = "3",
      width = 250,
      callback = function (c)
          c:struts({right = 250})
      end
    }
  }

Here, the strut appears 250 pixels wide on the right, and windows don't enter that. The pidgin window initially launches on the left of the screen and can be manually dragged into place

Manual struts with placement parameter

  { rule = { class = "Pidgin", role = "buddy_list" },
    properties = {
      floating = true,
      screen = 1,
      tag = "3",
      width = 250,
      placement = awful.placement.right,
      callback = function (c)
          c:struts({right = 250})
      end
    }
  }

Here the strut is still in place, but pidgin does not occupy the strut. It is loaded as far right as the strut will allow, in the working area of slave windows and overlaps with them

Manual struts with placement callback

  { rule = { class = "Pidgin", role = "buddy_list" },
    properties = {
      floating = true,
      screen = 1,
      tag = "3",
      width = 250,
      callback = function (c)
          c:struts({right = 250})
          awful.placement.right(c, { attach = true, update_workarea = true })
      end
    }
  }

This behavior is similar to the default. There is no strut, and slave windows overlap with the pidgin window.

psychon commented 7 years ago

Looks like @Elv13 is already working on this, so assigning to him. Feel free to remove the assignment if I am wrong. (My first thought was: Is this another duplicate of the "missing workarea updates" bug? But apparently it is not...)