Now I've noticed, Xfce automatically brings up the Display Configuration Utility when the monitor video cable is plugged in.

Please tell me how, what C/C++ API call or linux specific system callback or polling is Xfce using to detect this. I would *really* love to know this.

I've already done this via a udev rule and referencing a script to run when this happens but the problem is, this rule does not work when the NVIDIA drivers are installed.

Creating a script that polls /sys/class/drm/cardX-x/status is not reliable because it doesn't always report the correct status. For instance, my HDMI cable was disconnected but /sys/class/drm/card0-HDMI-A-1/status returned "connected" and that's not good.

Creating a script and running xrandr every few seconds is a bit heavy so this is no good either.

One alternative that works is to replace /usr/bin/xfce4-display-settings with my own script but I'd rather not do that and I would really like to know how does Xfce detect when a monitor is plugged in.

BTW, Xfce is the best DE of all times. I can never use anything else but Xfce.

Re: How does Xfce detect when a monitor is connected?

"A XRRScreenChangeNotifyEvent is sent to a client that has requested notification whenever the screen configuration is changed. A client can perform this request by calling XRRSelectInput, passing the display, the root window, and the RRScreenChangeNotifyMask mask.

XRRScreenConfiguration is an opaque data type containing the configuration information for a screen."

Re: How does Xfce detect when a monitor is connected?

Re: How does Xfce detect when a monitor is connected?

No problems and again, Xfce is absolutely awesome. Keep up the good work with the GTK 3.x port please and I expect the same level of customization, responsiveness and stability (not concerned about memory consumption, have plenty of it). One concerning thing which I hope won't be overlooked is the panel icon spacing / padding / sizing. Right now, my xfce4-panel icon spacing, padding and sizing between icons (launcher shortcuts and notification icons) is all equal (top, bottom, left and right) - this padding and sizing is adjustable via the theme. "Please" preserve this functionality with GTK 3.x. It's very pleasant to the eyes - it's all aesthetically spaced out.

Re: How does Xfce detect when a monitor is connected?

Keep up the good work with the GTK 3.x port please and I expect the same level of customization, responsiveness and stability (not concerned about memory consumption, have plenty of it).

filipbekic01 wrote:

I also have high hopes for GTK3 porting, can't wait actually.

The GTK3 port is looking good. Here is the current status. Looks alot like GTK2 Xfce, but with the newer toolkit:

(Xfce built off of current git tree - latest development versions of components)

Still as configurable as the GTK2 version, with theme/appearance tweaks now being done via css in gtk.css (instead of gtkrc-2.0). xfce4-panel still supports the older GTK2 plugins so they can still be used if they are not ported over to GTK3.