Re: [i3] [PATCH] Block outward events while processing commands.

  • From: Michael Stapelberg <michael@xxxxxxxx>
  • To: Discussions/Questions about the i3 window manager <i3-discuss@xxxxxxxxxxxxx>
  • Date: Sun, 01 Jul 2012 12:03:17 +0200

Hi,

Quoting DR (2012-07-01 09:28:51)

> PS. I have had a little thought about the situation you suggest where X
> representation is not changed after tree_render(). Wouldn't the unmap
command
> sent by i3bar queued after those sent by i3 in Xorg buffer? If so, it
won't be
> a problem.
You cannot make this assumption because of how i3 and i3bar might get
scheduled on your CPU.

But can you explain this a little further? All the workspaces events is sent
after the render commands have been sent to Xorg. So what schedule would make
i3bar's unmap command arrive before i3's render commands?
Actually, ipc_send_event("workspace", …) is called in _workspace_show in
src/workspace.c, which is called before tree_render() is called (see
src/commands.c:cmd_workspace for example).

So, i3bar can get the IPC event before i3 even sends the commands to
Xorg and thus it can send an unmap.

Best regards,
Michael

Other related posts: