Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPC reports wrong workspace in init event after a workspace move #3595

Closed
alexd2580 opened this issue Jan 19, 2019 · 1 comment
Closed

IPC reports wrong workspace in init event after a workspace move #3595

alexd2580 opened this issue Jan 19, 2019 · 1 comment
Assignees
Labels
4.16 bug missing-log Read the CONTRIBUTING.md file for instructions reproducible A bug that has been reviewed and confirmed by a project contributor

Comments

@alexd2580
Copy link

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

  • When using the IPC to listen to i3 events...
  • ... and moving a workspace (of an output with no other workspaces) to a different output...
  • ... the emitted workspace:init event references the moved workspace.

Expected Behavior

  • ... the emitted workspace:init event references the newly created workspace on the output from which the old workspace has been moved away.

Reproduction Instructions

  • Have multiple outputs set up side by side
    • Left output with empty workspace 1
    • Right output with empty workspace 2
  • Have an application which logs the workspace events running somewhere (not on right output)
  • Focus the right output
  • Use a keybinding to move the entire workspace to the left
    • bindsym $mod+Control+Left move workspace to output left
  • Observe event output: the current field lists workspace 2 instead of a new one (3?).

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.16 (2018-11-04) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.16 (2018-11-04) (pid 549)to abort…)
Loaded i3 config: /home/sascha/.config/i3/config (Last modified: Sa 19 Jan 2019 00:39:20 CET, 1953 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
set $mod Mod1
bindsym $mod+Control+Left move workspace to output left
bindsym $mod+Control+Right move workspace to output right
bindsym $mod+1 workspace 1
bindsym $mod+Shift+R restart
focus_follows_mouse yes
- Linux Distribution & Version:
Arch Linux
Linux libSascha.so.0.1 4.20.0-arch1-1-ARCH #1 SMP PREEMPT 
Mon Dec 24 03:00:40 UTC 2018 x86_64 GNU/Linux
- Are you using a compositor (e.g., xcompmgr or compton): Nope

Suspected code

Looking at this line ipc_send_workspace_event("init", ws, NULL);, it seems that instead of the newly created workspace (not referenced by variable here) the "init" event is fired with the current workspace (ws).

@i3bot
Copy link

i3bot commented Jan 19, 2019

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added bug missing-log Read the CONTRIBUTING.md file for instructions 4.16 labels Jan 19, 2019
orestisfl added a commit to orestisfl/i3 that referenced this issue Feb 22, 2019
Fixes i3#3595
Like the issue mentions:
> instead of the newly created workspace (not referenced by variable
> here) the `"init"` event is fired with the current workspace (`ws`).

Plus, there was another issue where duplicate workspace init events
where being sent because of workspace_get().

Fixes i3#3631
No event was being sent here:
https://github.com/i3/i3/blob/2d6e09a66ad9b3e01588c515ae66476de8903754/src/randr.c#L487
@orestisfl orestisfl added the reproducible A bug that has been reviewed and confirmed by a project contributor label Feb 22, 2019
orestisfl added a commit to orestisfl/i3 that referenced this issue Feb 23, 2019
Fixes i3#3595
Like the issue mentions:
> instead of the newly created workspace (not referenced by variable
> here) the `"init"` event is fired with the current workspace (`ws`).

Plus, there was another issue where duplicate workspace init events
where being sent because of workspace_get().

Fixes i3#3631
No event was being sent here:
https://github.com/i3/i3/blob/2d6e09a66ad9b3e01588c515ae66476de8903754/src/randr.c#L487

533-randr15.t: I confirmed that SKIP still works if the xrandr command
fails.
orestisfl added a commit to orestisfl/i3 that referenced this issue Feb 23, 2019
Fixes i3#3595
Like the issue mentions:
> instead of the newly created workspace (not referenced by variable
> here) the `"init"` event is fired with the current workspace (`ws`).

Plus, there was another issue where duplicate workspace init events
where being sent because of workspace_get().

304-ipc-workspace-init.t: Subtest "move workspace to output" fails with
current next.

Fixes i3#3631
No event was being sent here:
https://github.com/i3/i3/blob/2d6e09a66ad9b3e01588c515ae66476de8903754/src/randr.c#L487

533-randr15.t: I confirmed that SKIP still works if the xrandr command
fails.
Added test fails with current next.
@orestisfl orestisfl self-assigned this Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.16 bug missing-log Read the CONTRIBUTING.md file for instructions reproducible A bug that has been reviewed and confirmed by a project contributor
Projects
None yet
Development

No branches or pull requests

3 participants