bsc-performance-tools / wxparaver

wxParaver is a trace-based visualization and analysis tool designed to study quantitative detailed metrics and obtain qualitative knowledge of the performance of applications, libraries, processors and whole architectures.
http://tools.bsc.es/paraver
GNU Lesser General Public License v2.1
26 stars 3 forks source link

SetFocus after timeline redraw causes issues in Xmonad WM #18

Open Leixb opened 2 months ago

Leixb commented 2 months ago

Most WM can resize windows without focusing them. Currently, whenever the paraver timeline redraws, it steals focus.

This is mildly annoying since it can break the workflow in some WM.

However, Xmonad by default when having two monitors makes the current desktop and the desktop in the secondary monitor swap places, which with paraver sends the user into a loop of:

This means that paraver in Xmonad is not usable with two monitors unless you patch Xmonad to ignore focus requests from paraver.

Removing this setFocus call from the redraw function fixes the issue: https://github.com/bsc-performance-tools/wxparaver/blob/1db355c437c67b8fbe94b769250a00f0302fd6bb/src/gtimeline.cpp#L902

I don't think that setFocusis needed since in traditional DEs you already focus a window before resizing it. The only thing that could break someone's workflow is if they use forceRedraw to focus on the timelines?

rodarima commented 2 months ago

A similar problem also happens in i3 with a single monitor where the focus switches from Paraver and the first timeline window in a loop, at least when you open Paraver with a trace and a configuration from the command line.

I had to add an exception to make Paraver windows always floating.