dwm and multiple Screens

Everything about X, Gnome, KDE, ... and everything running on it

dwm and multiple Screens

Postby DebbyIan » 2017-06-05 17:34

dwm multi-monitor doesn't work correctly if I have two screen setup on a single X server. This is vanilla dwm compiled with the default Xinerama option enabled. Namely, the opposite of Xorg Xinerama.

I have two screens, Screen0 and Screen1. Screen0 is connected to two displays. dwm on Screen0 is stretched across both the displays. Flaw!

OTOH if I have two X servers, X0 and X1 each with Screen0, ie. :0.0 and :1.0 then dwm honours its anti-Xinerama feature and correctly shows a single monitor on each of the two displays.
DebbyIan
 
Posts: 106
Joined: 2013-05-09 12:12

Re: dwm and multiple Screens

Postby Head_on_a_Stick » 2017-06-05 18:07

Have you seen http://dwm.suckless.org/multi-monitor?

I've never owned a monitor so I probably can't help directly but it is always better to post the full content of any configuration files rather than a vague description :wink:
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: dwm and multiple Screens

Postby DebbyIan » 2017-06-05 18:32

You haven't understood the problem because you haven't read the post properly. Stop judging this as vague. It has been deliberately been made succinct to stop people like you taking the post in another direction. Did you read the post? If you haven't then which config files do you think you want to see?

The problem is quite clearly described. This is not any answer:

http://dwm.suckless.org/multi-monitor
DebbyIan
 
Posts: 106
Joined: 2013-05-09 12:12

Re: dwm and multiple Screens

Postby DebbyIan » 2017-06-05 18:35

DebbyIan wrote:dwm multi-monitor doesn't work correctly if I have two screen setup on a single X server. This is vanilla dwm compiled with the default Xinerama option enabled. Namely, the opposite of Xorg Xinerama.

I have two screens, Screen0 and Screen1. Screen0 is connected to two displays. dwm on Screen0 is stretched across both the displays. Flaw!

OTOH if I have two X servers, X0 and X1 each with Screen0, ie. :0.0 and :1.0 then dwm honours its anti-Xinerama feature and correctly shows a single monitor on each of the two displays.


NB. The issue only arises if you have a second screen (ie, :0.1) configured in Xorg. Regardless of whether :0.1 is being used or not. Most people set up multiple displays on a single screen (:0.0) and then use xrandr to configure the displays that way. In these cases dwm's anti-Xinerama works correctly.
DebbyIan
 
Posts: 106
Joined: 2013-05-09 12:12

Re: dwm and multiple Screens

Postby DebbyIan » 2017-06-06 12:00

There is clearly a small flaw in dwm's Xinerama implementation. Second, I believe it would be less confusing if Xinerama on was switched around with Xinerama off in keeping with Xorg's Xinerama. Essentially Xinerama on means span an application's display over several Screens or monitors. Xinerama off should mean, restrict an application's display to a single Screen or monitor that it's running on. At the moment you have to compile dwm with Xinerama libraries enabled in order to get a non-Xinerama effect.

So in addressing the earlier issue I have instead elected to setup several Screens (Screen0, Screen1) instead, and am running one instance of dwm on each Screen, :0.0 and :0.1. But there another flaw (again in dwm). When the pointer is moved to another Screen the keyboard focus does not automatically translate to the new Screen. I therefore propose an update to the function enternotify(XEvent *) such that:

Code: Select all
void
enternotify(XEvent *e)
{
   Client *c;
   Monitor *m;
   XCrossingEvent *ev = &e->xcrossing;

   if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
      return;
   c = wintoclient(ev->window);
   m = c ? c->mon : wintomon(ev->window);
   if (m != selmon) {
      unfocus(selmon->sel, 1);
      selmon = m;
+      }
-   } else if (!c || c == selmon->sel)
-      return;
   focus(c);
}
DebbyIan
 
Posts: 106
Joined: 2013-05-09 12:12


Return to Desktop & Multimedia

Who is online

Users browsing this forum: kopper, rick71 and 7 guests

fashionable