You are not logged in.

#26 2020-04-04 15:56:34

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

I just tried "urxvt -embed 0x_wid_of_tabbed", the result is the same as ever.

I usually reparent windows using a little script I wrote for this (which I meant to post here on the forum once the issue at hand is sorted out); please find it below.

However, for the sake of troubleshooting, I reparented using plain "xdotool windowreparent <windowID> <targetID>, so my script *should* not cause the issue.


This is my tabbing/untabbing script:

#!/bin/bash
#alltab-bspwm.sh brings tabbing functionality to bspwm. It relies on
#tabbed, xdotool, and xwininfo.

currentWID=$(bspc query -N -n focused)
case $1 in
    east|north|south|west)  targetID=$(bspc query -N -n $1) || exit 1
                            if bspc query -T -n focused | grep -q tabbed ; then
                                if bspc query -T -n $1 | grep -q tabbed ; then
                                    xdotool windowreparent $(xwininfo -id $currentWID -children | awk 'NR==7 {print $1}') $targetID
                                else
                                    bspc config -n $targetID border_width 0
                                    xdotool windowreparent $targetID $currentWID
                                fi
                            else
                                if bspc query -T -n $1 | grep -q tabbed ; then
                                    bspc config -n $currentWID border_width 0
                                    xdotool windowreparent $currentWID $targetID
                                else
                                    tabbedID=$(tabbed -c -d | tail -n 1)
                                    bspc config -n $currentWID border_width 0
                                    bspc config -n $targetID border_width 0
                                    xdotool windowreparent $currentWID $tabbedID
                                    xdotool windowreparent $targetID $tabbedID
                                fi
                            fi ;;
    detach)                 if bspc query -T -n focused | grep -q tabbed ; then
                                childWID=$(xwininfo -id $currentWID -children | awk 'NR==7 {print $1}')
                                xdotool windowreparent $childWID $(xwininfo -root | awk '/Window id:/ {print $4}')
                                bspc config -n $childWID border_width $(awk '/bspc config border_width/ {print $4}' ~/.config/bspwm/bspwmrc)
                            fi ;;
    *)                      echo "Usage: ./alltab-bspwm.sh [east|north|south|west|detach]"
                            echo "You probably want to add something like this to your sxhkdrc file:"
                            echo "# Tabbing functionality for bspwm"
                            echo "super + t; {h,j,k,l,d}"
                            echo "    /path/to/alltab-bspwm.sh {west,south,north,east,detach}" ;;
esac

Last edited by salonkommunist (2020-04-04 15:57:16)

Offline

#27 2020-04-05 00:19:34

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

Well, here's another piece of info: I just fired up my old laptop computer (which has Manjaro running...) and tried it there. It does the same freaking thing. What the hell??

Offline

#28 2020-04-05 14:42:12

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [solved] Detach a window from suckless' tabbed

What do the systems have in common?
The super-interesting part are your xephyr findings, so it has to be something about the session on the main X11 server.
(And comment #19 suggests that it's not a client)

Next question: can you reparent the window from one tabbed intance to another?

Offline

#29 2020-04-05 20:39:31

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

Well, hardware-wise, they are not very similar at all. The laptop computer is a Thinkpad T450s with hybrid graphics (Intel+Nvidia), whereas my desktop system (which I did all previous testing on) has a 2nd generation core i7 and an AMD RX580 graphics card in it.

The laptop runs Manjaro bspwm edition (i.e. Manjaro's preconfigured bspwm spin), whereas on the desktop system, I run plain Arch with a minimal Xorg + bspwm setup. I use the proprietary graphics drivers on both systems.


Reparenting between tabbed instances will exhibit the same issue as reparenting to the root window does.

Last edited by salonkommunist (2020-04-05 20:50:41)

Offline

#30 2020-04-05 21:30:33

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [solved] Detach a window from suckless' tabbed

Reparenting between tabbed instances will exhibit the same issue as reparenting to the root window does.

So pretty much everything that relates to "window management" is out of the, well… window and the cause is more likely to be the tabbed window itself. Except the xephyr test contrasts with that…

Did you maybe run tabbed w/ a different set of parameters? An alias? Or maybe different $PATH resolution?

The obvious contender would be bspwm, but unless you're second guessing your previous test on a naked X11 server, we ruled that out before. sad

Offline

#31 2020-04-05 22:07:59

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

I have tried several ways of calling tabbed:

a) "tabbed -c zathura -e"
b) "xdotool windowreparent <currentWID> $(tabbed -c -d | tail -n 1)"
c) just call "tabbed" from a terminal emulator

--> The behavior was always the same.
I use tabbed from the Arch repository, with no alterations whatsoever. No aliases involved, and its $PATH should be the same as for any other program I launch with my normal user account (afaik; I am far from an expert in general Linux internals).


Here is a brief summary of what I tried:

Reparenting a tabbed child window to the root window:

Arch /w bspwm --> no success
Manjaro /w bspwm --> no success
Arch /w openbox --> no success
Arch /w fluxbox --> no success
Arch /w empty X session --> no success
Arch /w nested Xephyr --> SUCCESS!

Reparenting a tabbed child window to another instance of tabbed:

Arch /w bspwm --> no success


Do you have any advice on X11 troubleshooting? I did check the logfile (and posted it earlier, see #20), but did not find anything suspicious (again, I am no expert). Or anything else worth checking out?

Last edited by salonkommunist (2020-04-05 22:12:24)

Offline

#32 2020-04-06 11:52:39

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [solved] Detach a window from suckless' tabbed

Not really. For the most part because I can't even imagine what's going on there…

If you monitor the substructure of the tabbed window, does that generate more events when reparenting a window out of tabbed (and onto the root)?

xev -event substructure -id 0xWID_OF_TABBED

Offline

#33 2020-04-06 13:01:31

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

This is the output, generated upon reparenting to the root window:

$ xev -event substructure -id 0x2000003

UnmapNotify event, serial 18, synthetic NO, window 0x2000003,
    event 0x2000003, window 0x1c0000a, from_configure NO

ReparentNotify event, serial 18, synthetic NO, window 0x2000003,
    event 0x2000003, window 0x1c0000a, parent 0x6be,
    (0,0), override NO

Seeing that: As I am monitoring events from the tabbed window, why does it not just unmap the child? Why would it be bothered with reparenting? Shouldn't that be handled "outside" tabbed?


Edit: During another reparenting to root action, I ran the above command on the root window itself. There is something more going on (though the border drawing should be due to my script):

ReparentNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x1c0000a, parent 0x6be,
    (0,0), override NO

ConfigureNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x2200003, (10,37), width 977, height 526,
    border_width 3, above 0x1e0000a, override NO

ConfigureNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x1c0000a, (10,579), width 977, height 485,
    border_width 0, above 0x1200430, override NO

ConfigureNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x1c0000a, (10,579), width 977, height 485,
    border_width 3, above 0x1200430, override NO

MapNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x1c0000a, override NO

ConfigureNotify event, serial 18, synthetic NO, window 0x6be,
    event 0x6be, window 0x1c0000a, (10,579), width 977, height 485,
    border_width 3, above 0x2200003, override NO

This output only shows entries that were generated while reparenting, I stripped anything before and after. I notice that there are several window IDs involved: 0x6be (root), 0x2200003 (tabbed), 0x1c0000a (detached window), 0x1200430 (???). I wonder what the latter window ID is? It is no child of tabbed (I checked that), nor is it polybar or the URxvt window which I ran the xev command in. There were no other (visible) windows present at that point in time, except for my unmapped scratchpad (which has a different window ID, I checked that too).

So there seems to be something involved that I cannot see or pinpoint, but which is given a window ID.

Last edited by salonkommunist (2020-04-06 13:25:52)

Offline

#34 2020-04-06 13:43:00

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [solved] Detach a window from suckless' tabbed

xwininfo -id 0x1200430
xprop -id 0x1200430

But that's just a hint where the window will go in the stack.

Both outputs look perfectly regular, there's no indication of sth. weird going on … :-(

Offline

#35 2020-04-09 02:26:03

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

I am marking this thread as "solved".

It is now working for me after I uninstalled tabbed and then compiled it myself directly from the suckless source. There seems to be some sort of issue with the Arch repo version, at least for me.

Offline

#36 2020-04-09 06:10:45

seth
Member
Registered: 2012-09-03
Posts: 51,299

Re: [solved] Detach a window from suckless' tabbed

Ok… I can actually reproduce that…
The reason is that the repo version is, like the last release, actually dead old (6 years) and handling for UnmapNotify events is simply absent from that code.
I guess nobody™ notices that because nobody™ useses the precompiled versions of suckless tools (cause you want your own colors and stuff)

https://bugs.archlinux.org/task/66180

Sorry, we could have had this much faster.

Offline

#37 2020-04-09 10:45:07

salonkommunist
Member
From: Germany
Registered: 2020-02-18
Posts: 36

Re: [solved] Detach a window from suckless' tabbed

seth wrote:

Sorry, we could have had this much faster.

There is no need to be sorry at all, I missed that too. Thank you for all your time and effort!

Offline

#38 2020-05-03 00:57:01

anotherAlex154
Member
Registered: 2018-10-20
Posts: 10

Re: [solved] Detach a window from suckless' tabbed

Hi,
I had this exact problem with the AUR tabbed package. I uninstalled it, and installed the AUR tabbed-git version instead, and everything appears to have been fixed.


"Hey hey hey, everyone part like the Red Sea, it's me" -- Shaggy Rogers

Offline

Board footer

Powered by FluxBB