baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.79k stars 414 forks source link

Don't center floating windows that request a position. #78

Closed Stebalien closed 11 years ago

Stebalien commented 11 years ago

As of 114881d958a25ddbfb6f5098bee7f76fbac4a9ef, all floating windows are centered on map. However, this means that windows that request a specific location are mapped to the center of the screen regardless. This interferes with programs like ftjerm, tilda, etc.

Is there any way to avoid centring windows that request positions?

baskerville commented 11 years ago

The aforementioned commit was reverted in d396210, and the fit_monitor function was reworked in later commits.

Things should be working fine as of 44ab9fc.

At least it works fine for me with sxiv -g ....

Stebalien commented 11 years ago

Unfortunately, ftjerm still doesn't work. If I move the window a little, hide it, and then re-show it, it reappears in the correct location. However, the second I click on another window and then hide/show (or even restart) ftjerm it starts showing up in the center of the screen again. However, this may be a weird bug in ftjerm where it assumes that the window manager will map it to it's last location (sxiv works). If my explanation doesn't make sense, tell me. I'm on no sleep right now.

supplantr commented 11 years ago

This appears to affect st as well. A new st window is always centered regardless of the specified geometry; however, if said window is moved with the pointer, unmapped, and remapped, it appears in the previous position as expected.

baskerville commented 11 years ago

I would like to underline the fact that there's no requests involved here, i.e. we're not talking about configure requests but about the initial size/position.

@Stebalien: ftjerm always resets its size and position when it maps itself. On a side note: why would you want to use this instead of writing scripts/rules for your regular terminal?

@Supplantr: both assumptions are false in the general case and I will fix the associated bugs ASAP.

Stebalien commented 11 years ago

Good point:

#!/bin/bash
WID=$(xdo id -n "dropterm" | head -1)
if [[ -n "$WID" ]]; then
    if bspc query -W -w $WID > /dev/null; then
        xdo hide $WID
    else
        xdo show $WID
    fi
else
    termite --geometry="550x350-5-5" --name="dropterm" --exec tmux &
fi
baskerville commented 11 years ago

Do you intend to make the dropterm window appear at the bottom right corner of the focused monitor?

Stebalien commented 11 years ago

Initially, I was trying to get it to appear at the absolute position specified (I was going to modify the script to make it choose the correct monitor). However, as most programs don't seem to take multiple monitors into account, it's probably better to just put windows on the focused monitor by default (i.e. #81).

However, as this bug appears to be fixed, I'll close the report. Thanks.

Stebalien commented 11 years ago

Also, in case anyone ever wonders, here is my final working version (it's kind of complicated because termite creates a hidden window):

#!/bin/bash
WIDS=$(xdo id -n "dropterm")
for wid in ${WIDS[@]}; do
    if [[ "$(xprop -id $wid '=$0' _NET_WM_WINDOW_TYPE)" == '_NET_WM_WINDOW_TYPE(ATOM)=_NET_WM_WINDOW_TYPE_NORMAL' ]]; then
        WID=$wid
    fi
done
if [[ -n "$WID" ]]; then
    if bspc query -W -w $WID 2>/dev/null; then
        xdo hide $WID
    else
        xdo show $WID
    fi
else
    termite --geometry="550x350-4-4" --name="dropterm" --exec tmux &
fi