mihirlad55 / polybar-dwm-module

A dwm module for polybar
MIT License
116 stars 15 forks source link

Multimonitor issues #14

Closed juacq97 closed 3 years ago

juacq97 commented 4 years ago

Today I get a new monitor and I'm trying to create a multimonitor setup, but the dwm module only works as expected on the monitor 1 (at the left), on monitor 2 (at the right) it doesn't show anything.

Left monitor m1

Right monitor m2

Here is my polybar config file

mihirlad55 commented 4 years ago

What doesn't it show? What exactly is working on the left monitor that doesn't on the right? Is it always the right monitor that doesn't work correctly if you restart polybar a bunch of times? Which monitor's bar is launched first when you launch the bars?

juacq97 commented 4 years ago

it works sometimes, as you can see in the picture, on the 2nd. monitor appears all as empty tags (when one of them is ocuppied), if I change tags (with the shiftview patch) the focused tag on polybar don't change. Right now the module is working, but when I click to change to other tag takes a lot of time to do it, and the bar at the second monitor is opaque, not transparent (this is more a polybar issue than your module though)

mihirlad55 commented 4 years ago

For the issue where the selected tag appears empty, it's because you have the following in your config:

; unfocused = Inactive tag on any monitor
label-unfocused = %name%
label-unfocused-padding = 1

This is the state of a selected tag on an unfocused monitor regardless of if its occupied.

Now for your other issues. First, please double check to make sure you are using the latest version of the module and the patch.

How long does it take to switch tags? One thing that could be a potential cause is you using the module multiple times, though this shouldn't significantly affect performance. Each use of the module opens two connections to dwm, so your polybar bars in total are using 8 connections. I don't see any issues on my computer when I use the module twice on each of my two bars, so I'm not sure if this would be causing the delay.

With the shiftview patch, does it never change, or only sometimes not change? One thing I'd like you to check for this is running dwm-msg subscribe tag_change_event and tell me if using the shiftview patch results in dwm-msg receiving tag change event messages.

Do any of these issues occur if you run only one instance of the module on each bar?

juacq97 commented 4 years ago

I downloaded the lastest version and try again with one instance of the module, is still taking a lot of time (4 or 5 seconds) to change tags when I click on the module, with shiftview changes immediately.

Here's the output of dwm-msg subscribe tag_change_event, the first two events are with shiftview, the last two are clicking on the bar.

```
❯ dwm-msg subscribe tag_change_event
{"result":"success"}
{
    "tag_change_event": {
        "monitor_number": 0,
        "old_state": {
            "selected": 1,
            "occupied": 1,
            "urgent": 0
        },
        "new_state": {
            "selected": 2,
            "occupied": 1,
            "urgent": 0
        }
    }
}

{
    "tag_change_event": {
        "monitor_number": 0,
        "old_state": {
            "selected": 2,
            "occupied": 1,
            "urgent": 0
        },
        "new_state": {
            "selected": 1,
            "occupied": 1,
            "urgent": 0
        }
    }
}

{
    "tag_change_event": {
        "monitor_number": 0,
        "old_state": {
            "selected": 1,
            "occupied": 1,
            "urgent": 0
        },
        "new_state": {
            "selected": 16,
            "occupied": 1,
            "urgent": 0
        }
    }
}

{
    "tag_change_event": {
        "monitor_number": 0,
        "old_state": {
            "selected": 16,
            "occupied": 1,
            "urgent": 0
        },
        "new_state": {
            "selected": 1,
            "occupied": 1,
            "urgent": 0
        }
    }
}
```

mihirlad55 commented 4 years ago

I'm not interested in the output of dwm-msg subscribe tag_change_event, rather if there's a delay in receiving messages when you change tags. With that command running in a terminal, let me know if there are any delays in receiving messages after changing tags by different methods i.e. clicking on polybar, using MOD+, using shiftview. This should help narrow down if this is a module problem or an IPC patch problem.

After that I'd like you to tell me if there is any delay (either updating polybar, or actual tag changing) when running the following command: dwm-msg run_command view <some number>

Also, when you click the the tag on polybar, is the delay in actually switching tags or just updating the bar?

juacq97 commented 4 years ago

There's delay only when I change to an empty tag. Example, if I'm on tag 2 with a terminal and change to tag 3 which is empty, the dwm module updates (the focused symbol changes to the tag 3), but the windows still visible like for 5 seconds or more. This only happens when I use the polybar panel to change tags. There's no delay on the output of dwm-msg subscribe tag_change_event. There's no delay when running dwm-msg run_command view <some number> neither.

mihirlad55 commented 4 years ago

Are you using the anybar patch? This issue may be the issue described here: https://github.com/mihirlad55/polybar-dwm-module/issues/1. Let me know if that describes the issue you seem to be having.

Try the following:

  1. Click an occupied tag on polybar
  2. Click an empty tag on polybar
  3. Move your cursor off the bar

Tell me if the actual tag change appears as soon as the cursor is off the bar.

juacq97 commented 4 years ago

Ok, that is. When I move the mouse from the bar the tag changes. I feel kinda dumb that I didn't realize that before

mihirlad55 commented 4 years ago

No worries, it took me forever to detect this issue a while ago. Do you have the anybar patch applied though? One of the things the patch is supposed to do is fix this issue. Your config says override-redirect = false which leads me to believe you do have it applied, but if you have it applied, this issue should not be occurring.

juacq97 commented 4 years ago

Yes, I have it, I manually checked the patch and the dwm.c to be sure that all the code was applied (sometimes some hunks fails, but I don't realize and the program compile).

mihirlad55 commented 4 years ago

I took a look at your dwm repo, but I didn't find anything wrong.

Would you mind trying the polybar module on dwm with only the IPC patch and anybar patch applied? This would help determine if there is a conflicting patch or something else causing this.

juacq97 commented 4 years ago

It happens the same using a fresh build of dwm with just the IPC and anybar patch

mihirlad55 commented 4 years ago

I can't seem to reproduce this issue. It's weird that this is happening with the anybar patch applied. This might take some deeper debugging to determine the issue. Just so I can have all the details, could you reply with the following in the following format:

https://github.com/mihirlad55/polybar-dwm-module/blob/master/.github/ISSUE_TEMPLATE/bug_report.md

juacq97 commented 4 years ago

name: Bug Report about: Create a report for something that misbehaves

Describe the issue

When I click on an empty tag on the dwm module it doesn't change until I move the mouse cursor away from the bar.

Expected behavior: The tag change immediately after I click the tag I want to see

Actual behavior: The tag doesn't change until I move the mouse away from the bar.

Was it working before?

To Reproduce

A minimal but complete config with which the problem occurs:

[colors]
background      = #00282a36
foreground          = ${xrdb:foreground}
color1          = ${xrdb:color1}
color2          = ${xrdb:color2}
color3          = ${xrdb:color3}
color4          = ${xrdb:color4}
color5          = ${xrdb:color5}
color6          = ${xrdb:color6}
color7          = ${xrdb:color7}
color8          = ${xrdb:color8}
color9          = ${xrdb:color9}
color10         = ${xrdb:color10}
color11         = ${xrdb:color11}
color12         = ${xrdb:color12}
color13         = ${xrdb:color13}
color14         = ${xrdb:color14}
color15         = ${xrdb:color15}

[bar/example]
monitor         = ${env:MONITOR:}
width           = 100%
height          = 25
radius          = 0
fixed-center        = true
enable-ipc      = true
background      = ${colors.background}
foreground      = ${colors.foreground}
offset-x        = 0
line-size       = 2
line-color      = 
border-bottom-size  = 0
border-top-size     = 0
border-top-color    = ${colors.background}
border-bottom-color     = ${colors.background}
border-size         = 
border-color        = 4padding-left         = 0
padding-right       = 0
module-margin-left  = 
module-margin-right     = 
locale          = es_MX.UTF-8

font-0 = Source Code Pro:style:medium:size=8;1
font-1 = Material Design Icons:style=Regular:pixelsize=13:antialias=true;3
font-2 = MesloLGS NF:style=Regular:size=15;3
font-3 = Weather Icons:size=12;2

modules-left    =  sep dwm-layout sep xwindow sep spotify
modules-center  = dwm
modules-right   =  date sep key-icon xkeyboard sep arch sep vol-icon pulseaudio sep bat-icon battery sep net
tray-position   = none
tray-padding    = 0
tray-background  = 
;tray-underline   = #1C98C9
;tray-detached    = true
override-redirect   = false

cursor-click = pointer
cursor-scroll = ns-resize

[module/dwm]
type = internal/dwm
format = <label-tags> 

enable-tags-click = true
enable-layout-click = true
enable-layout-scroll = true
layout-scroll-wrap = true
layout-scroll-reverse = false
; If enable-layout-click = true, clicking the layout symbol will switch to this layout
secondary-layout-symbol = [M]

; Separator in between shown tags
; label-separator = |

; Title of currently focused window
; Available tokens:
;   %title%
label-title = %title%
label-title-padding = 1 
label-title-foreground = ${colors.foreground}
label-title-maxlen = 30

; Symbol of current layout
; Available tokens:
;   %symbol%
label-layout = %symbol%
label-layout-padding = 0
label-layout-foreground = ${colors.foreground}
label-layout-background = ${colors.background}

; Text to show when currently focused window is floating
label-floating = F

; States: focused, unfocused, visible, urgent, empty
; Available tokens:
;   %name%

; focused = Active tag on focused monitor
label-focused = 󰪥
label-focused-background = ${colors.background}
label-focused-foreground = ${colors.foreground}
label-focused-underline= 
label-focused-padding = 0

; unfocused = Inactive tag on any monitor
label-unfocused = 󰪥
label-unfocused-padding = 1

; visible = Active tag on unfocused monitor
label-visible = 󰝦
label-visible-background = ${colors.background}
label-visible-foreground = ${colors.foreground}
label-visible-underline = 
label-visible-padding = 0

; urgent = Tag with urgency hint set
label-urgent = %name%
label-urgent-background = #aeaeae
label-urgent-padding = 1

; empty = Tags with no windows assigned
; This can be set to an empty string to hide empty tags
label-empty = "󰧟"
label-empty-background = ${colors.background}
;label-empty-foreground = ${colors.color4}
label-empty-padding = 0

List any other steps needed to reproduce the issue besides starting polybar with the config you posted above.

  1. Move the mouse over the dwm module.
  2. Click on the tag I want to see
  3. Move the cursor away from the panel

Polybar Log

Post everything polybar outputs to the terminal when you run it and the issue occurs below

notice: Parsing config file: /home/juan/.config/polybar/dwm
- config_parser: Parsing /home/juan/.config/polybar/dwm
* Enabling xresource manager
* Created ipc channel at: /tmp/polybar_mqueue.6719
* Environment var ${MONITOR} is undefined, using defined fallback value ""
* Loaded monitor LVDS-1 (1600x900+0+0)
* Found matching X resource "foreground" (value=#fbf2c7)
* Bar geometry: 1600x25+0+0; Borders: 0,0,0,0
- bar: Attach X event sink
- bar: Attach signal receiver
- controller: Install signal handler
- controller: Setup user-defined modules
* module/dwm-layout: Initialized formatter and labels
* module/dwm-layout: Connected to dwm socket
* module/dwm-layout: Initialized monitors
* module/dwm-layout: Initialized layout label
* module/dwm-layout: Subscribed to monitor focus change
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* module/dwm: Initialized formatter and labels
* module/dwm: Connected to dwm socket
* module/dwm: Initialized monitors
* module/dwm: Initialized tags
* module/dwm: Subscribed to monitor focus change
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "color1" (value=#cc241d)
* Found matching X resource "color13" (value=#d3869b)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "color11" (value=#fabd2f)
- pulseaudio: started mainloop
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1b.0.analog-stereo
* Found matching X resource "color9" (value=#fb4934)
* Found matching X resource "color14" (value=#8ec07c)
- pulseaudio: started mainloop
notice: pulseaudio: using default sink alsa_output.pci-0000_00_1b.0.analog-stereo
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "color7" (value=#a89984)
* Found matching X resource "color10" (value=#b8bb26)
* Found matching X resource "color12" (value=#83a598)
* Found matching X resource "color10" (value=#b8bb26)
- module/bat-icon: Attach inotify at /sys/class/power_supply/BAT0/energy_now
- module/bat-icon: Attach inotify at /sys/class/power_supply/BAT0/status
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
- module/battery: Attach inotify at /sys/class/power_supply/BAT0/energy_now
- module/battery: Attach inotify at /sys/class/power_supply/BAT0/status
* Found matching X resource "foreground" (value=#fbf2c7)
* Found matching X resource "foreground" (value=#fbf2c7)
* Starting application
- controller: Main thread id = 1
* Starting module/sep
* Starting module/dwm-layout
* Starting module/sep
- module/dwm-layout: Thread id = 2
- module/sep: Thread id = 3
* Starting module/xwindow
- module/sep: Thread id = 4
* Starting module/sep
* Starting module/spotify
- module/sep: Thread id = 5
* Starting module/dwm
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
* Starting module/date
- module/dwm: Thread id = 6
- command: Waiting for pid 6730 to finish...
- module/xwindow: Thread id = 7
* Starting module/sep
- module/date: Thread id = 8
* Starting module/key-icon
* Starting module/xkeyboard
* Starting module/sep
- module/xkeyboard: Thread id = 9
* Starting module/arch
- module/sep: Thread id = 10
* Starting module/sep
* module/arch: Invoking shell command: "~/.config/polybar/scripts/updates-arch.sh"
* Starting module/vol-icon
- module/sep: Thread id = 11
- module/vol-icon: Thread id = 12
* Starting module/pulseaudio
* Starting module/sep
* Starting module/bat-icon
- module/sep: Thread id = 13
* Starting module/battery
- module/bat-icon: Start of subthread
* Starting module/sep
- module/battery: Thread id = 14
* Starting module/net
* Entering event loop (thread-id=1)
- module/sep: Thread id = 15
- command: Waiting for pid 6738 to finish...
- module/bat-icon: Thread id = 16
- module/battery: Inotify event reported for /sys/class/power_supply/BAT0/energy_now
- module/sep: Thread id = 17
- module/net: Thread id = 18
* Eventqueue worker (thread-id=19)
- bar: Create renderer
- renderer: Get TrueColor visual
- renderer: Allocate colormap
- renderer: Allocate output window
- module/key-icon: Thread id = 20
- renderer: Allocate window pixmaps
- renderer: Allocate graphic contexts
- renderer: Allocate alignment blocks
- renderer: Allocate cairo components
- renderer: Load fonts
* Configured DPI = 96x96
- module/pulseaudio: Thread id = 21
notice: Loaded font "Source Code Pro:style:medium:size=8" (name=Source Code Pro, offset=1, file=/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Medium.otf)
notice: Loaded font "Material Design Icons:style=Regular:pixelsize=13:antialias=true" (name=Material Design Icons, offset=3, file=/usr/share/fonts/materialdesignicons-webfont.ttf)
notice: Loaded font "MesloLGS NF:style=Regular:size=15" (name=MesloLGS NF, offset=3, file=/usr/share/fonts/TTF/MesloLGS-NF-Regular.ttf)
notice: Loaded font "Weather Icons:size=12" (name=Weather Icons, offset=2, file=/home/juan/.local/share/fonts/weathericons.ttf)
* Bar window: 0x1800002
- bar: Reconfigure window
- bar: Set window WM_NAME
- bar: Set window _NET_WM_WINDOW_TYPE
- bar: Set window _NET_WM_STATE
- bar: Set window _NET_WM_DESKTOP
- bar: Set window _NET_WM_PID
- bar: Map window
- bar: Draw empty bar
- bar: Received expose event
- bar: Setup tray manager
* module/sep: Rebuilding cache
* module/dwm-layout: Rebuilding cache
* module/dwm-layout: Building module
* module/dwm-layout: Building layout label
* module/sep: Rebuilding cache
* module/xwindow: Rebuilding cache
* module/sep: Rebuilding cache
* module/spotify: Rebuilding cache
* module/dwm: Rebuilding cache
* module/dwm: Building module
* module/dwm: Building tags label
* module/date: Rebuilding cache
* module/sep: Rebuilding cache
* module/key-icon: Rebuilding cache
* module/xkeyboard: Rebuilding cache
* module/sep: Rebuilding cache
* module/arch: Rebuilding cache
* module/sep: Rebuilding cache
* module/vol-icon: Rebuilding cache
* module/pulseaudio: Rebuilding cache
* module/sep: Rebuilding cache
* module/bat-icon: Rebuilding cache
* module/battery: Rebuilding cache
* module/sep: Rebuilding cache
* module/net: Rebuilding cache
- bar: Force update
* Redrawing bar window
- renderer: flush(1 geom=150x25+0+0, falloff=0)
- renderer: flush(2 geom=102x25+749+0, falloff=0)
- renderer: flush(3 geom=372x25+1228+0, falloff=0)
- command: Exited with status 0
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6771 to finish...
- command: Exited with status 0
- bar: Detected motion: 0 at pos(486, 0)
- No matching cursor area found
- bar: Detected motion: 0 at pos(488, 0)
- bar: Detected motion: 0 at pos(494, 0)
- bar: Detected motion: 0 at pos(500, 0)
- bar: Detected motion: 0 at pos(506, 0)
- bar: Detected motion: 0 at pos(512, 0)
- bar: Detected motion: 0 at pos(515, 0)
- bar: Detected motion: 0 at pos(517, 0)
- bar: Detected motion: 0 at pos(520, 0)
- bar: Detected motion: 0 at pos(523, 0)
- bar: Detected motion: 0 at pos(526, 0)
- bar: Detected motion: 0 at pos(532, 1)
- bar: Detected motion: 0 at pos(535, 3)
- bar: Detected motion: 0 at pos(540, 5)
- bar: Detected motion: 0 at pos(548, 9)
- bar: Detected motion: 0 at pos(557, 14)
- bar: Detected motion: 0 at pos(564, 18)
- bar: Detected motion: 0 at pos(570, 21)
- bar: Detected motion: 0 at pos(575, 22)
- bar: Detected motion: 0 at pos(579, 24)
- bar: Detected motion: 0 at pos(676, 24)
- bar: Detected motion: 0 at pos(685, 23)
- bar: Detected motion: 0 at pos(694, 22)
- bar: Detected motion: 0 at pos(705, 19)
- bar: Detected motion: 0 at pos(718, 17)
- bar: Detected motion: 0 at pos(731, 15)
- bar: Detected motion: 0 at pos(742, 14)
- bar: Detected motion: 0 at pos(753, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(764, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(772, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(776, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(778, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(779, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(781, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(782, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(784, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(787, 9)
- Found matching input area
- bar: Detected motion: 0 at pos(791, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(794, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(797, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(800, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(802, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(803, 10)
- Found matching input area
- command: Exited with status 0
* module/arch: Rebuilding cache
* Redrawing bar window
- renderer: flush(1 geom=150x25+0+0, falloff=0)
- renderer: flush(2 geom=102x25+749+0, falloff=0)
- renderer: flush(3 geom=424x25+1176+0, falloff=0)
- bar: Detected motion: 0 at pos(802, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(802, 11)
- Found matching input area
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- bar: Detected motion: 0 at pos(801, 11)
- command: Waiting for pid 6776 to finish...
- Found matching input area
- command: Exited with status 0
- bar: Detected motion: 0 at pos(800, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(799, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(798, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(797, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(796, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(796, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(795, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(794, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(793, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(792, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(791, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(789, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(788, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(787, 11)
- Found matching input area
- bar: Received button press: 1 at pos(787, 11)
- Found matching input area
* module/dwm-layout: Sending workspace view command to ipc handler
* module/dwm: Rebuilding cache
* module/dwm: Building module
* module/dwm: Building tags label
* Redrawing bar window
- renderer: flush(1 geom=150x25+0+0, falloff=0)
- renderer: flush(2 geom=102x25+749+0, falloff=0)
- renderer: flush(3 geom=424x25+1176+0, falloff=0)
- bar: Detected motion: 0 at pos(787, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(785, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(784, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(783, 14)
- Found matching input area
- bar: Detected motion: 0 at pos(782, 14)
- Found matching input area
- bar: Detected motion: 0 at pos(779, 15)
- Found matching input area
- bar: Detected motion: 0 at pos(777, 16)
- Found matching input area
- bar: Detected motion: 0 at pos(774, 17)
- Found matching input area
- bar: Detected motion: 0 at pos(771, 18)
- Found matching input area
- bar: Detected motion: 0 at pos(768, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(767, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(763, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(762, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(761, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(759, 18)
- Found matching input area
- bar: Detected motion: 0 at pos(758, 17)
- Found matching input area
- bar: Detected motion: 0 at pos(757, 16)
- Found matching input area
- bar: Detected motion: 0 at pos(756, 15)
- Found matching input area
- bar: Detected motion: 0 at pos(756, 14)
- Found matching input area
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6777 to finish...
- bar: Detected motion: 0 at pos(756, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(755, 13)
- Found matching input area
- command: Exited with status 0
- bar: Detected motion: 0 at pos(755, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(755, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(756, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(758, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(761, 11)
- Found matching input area
- bar: Detected motion: 0 at pos(763, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(764, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(767, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(768, 15)
- Found matching input area
- bar: Detected motion: 0 at pos(769, 17)
- Found matching input area
- bar: Detected motion: 0 at pos(770, 19)
- Found matching input area
- bar: Detected motion: 0 at pos(771, 23)
- Found matching input area
* module/xwindow: Rebuilding cache
* module/key-icon: Rebuilding cache
* module/xkeyboard: Rebuilding cache
* Redrawing bar window
- renderer: flush(1 geom=80x25+0+0, falloff=0)
- renderer: flush(2 geom=102x25+749+0, falloff=0)
- renderer: flush(3 geom=424x25+1176+0, falloff=0)
- bar: Detected motion: 0 at pos(769, 20)
- Found matching input area
- bar: Detected motion: 0 at pos(766, 13)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 8)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 5)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 2)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(765, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(764, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(764, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(763, 0)
- Found matching input area
- bar: Detected motion: 0 at pos(762, 2)
- Found matching input area
- bar: Detected motion: 0 at pos(762, 3)
- Found matching input area
- bar: Detected motion: 0 at pos(762, 4)
- Found matching input area
- bar: Detected motion: 0 at pos(761, 5)
- Found matching input area
- bar: Detected motion: 0 at pos(760, 6)
- Found matching input area
- bar: Received button press: 1 at pos(760, 6)
- Found matching input area
* module/dwm-layout: Sending workspace view command to ipc handler
* module/xwindow: Rebuilding cache
* module/dwm: Rebuilding cache
* module/dwm: Building module
* module/dwm: Building tags label
* Redrawing bar window
- renderer: flush(1 geom=150x25+0+0, falloff=0)
- renderer: flush(2 geom=102x25+749+0, falloff=0)
- renderer: flush(3 geom=424x25+1176+0, falloff=0)
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6778 to finish...
- command: Exited with status 0
- bar: Detected motion: 0 at pos(760, 7)
- Found matching input area
- bar: Detected motion: 0 at pos(760, 8)
- Found matching input area
- bar: Detected motion: 0 at pos(760, 10)
- Found matching input area
- bar: Detected motion: 0 at pos(760, 12)
- Found matching input area
- bar: Detected motion: 0 at pos(759, 16)
- Found matching input area
- bar: Detected motion: 0 at pos(759, 19)
- Found matching input area
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6779 to finish...
- command: Exited with status 0
* module/bat-icon: Polling values (inotify fallback)
* module/battery: Polling values (inotify fallback)
- module/bat-icon: Inotify event reported for /sys/class/power_supply/BAT0/energy_now
- module/battery: Inotify event reported for /sys/class/power_supply/BAT0/energy_now
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6780 to finish...
- command: Exited with status 0
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6781 to finish...
- command: Exited with status 0
* module/spotify: Invoking shell command: "python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}'"
- command: Waiting for pid 6782 to finish...
- command: Exited with status 0
notice: Termination signal received, shutting down...
- controller: Uninstall sighandler
- controller: Detach signal receiver
- controller: Stop modules
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/dwm-layout: Disconnecting from socket
* module/dwm-layout: Stopping
- module/dwm-layout: Release sleep lock
* Deconstruction of module/dwm-layout took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/xwindow: Stopping
- module/xwindow: Release sleep lock
* Deconstruction of module/xwindow took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
- module/spotify: Release sleep lock
* module/spotify: Stopping
- module/spotify: Release sleep lock
* Deconstruction of module/spotify took 0 ms.
* module/dwm: Disconnecting from socket
* module/dwm: Stopping
- module/dwm: Release sleep lock
* Deconstruction of module/dwm took 0 ms.
* module/date: Stopping
- module/date: Release sleep lock
* Deconstruction of module/date took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/key-icon: Stopping
- module/key-icon: Release sleep lock
* Deconstruction of module/key-icon took 0 ms.
* module/xkeyboard: Stopping
- module/xkeyboard: Release sleep lock
* Deconstruction of module/xkeyboard took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
- module/arch: Release sleep lock
* module/arch: Stopping
- module/arch: Release sleep lock
* Deconstruction of module/arch took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/vol-icon: Stopping
- module/vol-icon: Release sleep lock
* Deconstruction of module/vol-icon took 0 ms.
* module/pulseaudio: Stopping
- module/pulseaudio: Release sleep lock
* Deconstruction of module/pulseaudio took 0 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/bat-icon: Stopping
- module/bat-icon: End of subthread
- module/bat-icon: Release sleep lock
* Deconstruction of module/bat-icon took 244 ms.
* module/battery: Stopping
- module/battery: Release sleep lock
* Deconstruction of module/battery took 215 ms.
* module/sep: Stopping
- module/sep: Release sleep lock
* Deconstruction of module/sep took 0 ms.
* module/net: Stopping
- module/net: Release sleep lock
* Deconstruction of module/net took 0 ms.
- controller: Joining threads
- module/sep: Deconstructing
- module/dwm-layout: Deconstructing
- module/sep: Deconstructing
- module/xwindow: Deconstructing
- module/sep: Deconstructing
- module/spotify: Deconstructing
- module/dwm: Deconstructing
- module/date: Deconstructing
- module/sep: Deconstructing
- module/key-icon: Deconstructing
- module/xkeyboard: Deconstructing
- module/sep: Deconstructing
- module/arch: Deconstructing
- module/sep: Deconstructing
- module/vol-icon: Deconstructing
- module/pulseaudio: Deconstructing
- module/sep: Deconstructing
- module/bat-icon: Deconstructing
- module/battery: Deconstructing
- module/sep: Deconstructing
- module/net: Deconstructing
- ipc: Removing file handle
* Waiting for spawned processes to end
* Reached end of application...

(I kill it after the I reproduce the issue).

Environment:

Features: +alsa +curl +dwm -i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release Compiler: /usr/bin/clang++ Compiler flags: -Wall -Wextra -Wpedantic -Wno-error=parentheses-equality -Wno-zero-length-array -O3 -DNDEBUG Linker flags:

mihirlad55 commented 4 years ago

Hey, sorry for the long delay. School just started and I just got busy. Could you try adding this line as shown below:

diff --git a/dwm.c b/dwm.c
index a8f4084..8568d99 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1460,6 +1460,7 @@ run(void)
                                                        tags, LENGTH(tags), layouts, LENGTH(layouts)) < 0) {
                                        fprintf(stderr, "Error handling IPC event on fd %d\n", event_fd);
                                }
+                               XSync(dpy, False);
                        } else {
                                fprintf(stderr, "Got event from unknown fd %d, ptr %p, u32 %d, u64 %lu",
                                                event_fd, events[i].data.ptr, events[i].data.u32,

If this fixes the issue, then it should verify what I believe is the underlying cause that the XEvent queue is not being flushed immediately after the IPC command is sent from polybar.

mihirlad55 commented 3 years ago

Are you still having this issue?

juacq97 commented 3 years ago

Are you still having this issue?

No!, it was solved after I added that patch, I forgot about it because I started to work and everything, sorry! It works flawlesly now!