As suggested in comment 49 I think proper solution is enable crtc upon reconnection IF it is disabled.
Here is a prototype for patch - I'm hoping maintainer (Sean?) can suggest "correct code" to enable crtc.
diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c index 095e323..af70256 100644 --- a/xfsettingsd/displays.c +++ b/xfsettingsd/displays.c @@ -415,6 +415,7 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent, XfceRROutput *output, *o; XEvent *e = xevent; gint event_num; + gint j; guint n, m, nactive = 0; gboolean found = FALSE, changed = FALSE;
@@ -496,9 +497,37 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent, { xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "New output connected: %s", output->info->name); + /* need to enable crtc for output ? */ + if (output->info->crtc == None) + { + xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "enabling crtc for %s", output->info->name); + crtc = xfce_displays_helper_find_usable_crtc (helper, output); + if (crtc) + { + crtc->mode = output->preferred_mode; + crtc->rotation = RR_Rotate_0; + crtc->x = crtc->y = 0; + /* set width and height */ + for (j = 0; j < helper->resources->nmode; ++j) + { + if (helper->resources->modes[j].id == output->preferred_mode) + { + crtc->width = helper->resources->modes[j].width; + crtc->height = helper->resources->modes[j].height; + break; + } + } + xfce_displays_helper_set_outputs (crtc, output); + crtc->changed = TRUE; + } + } + changed = TRUE; } } + if (changed) + xfce_displays_helper_apply_all (helper); + /* Start the minimal dialog according to the user preferences */ if (changed && xfconf_channel_get_bool (helper->channel, NOTIFY_PROP, FALSE)) xfce_spawn_command_line_on_screen (NULL, "xfce4-display-settings -m", FALSE,
As suggested in comment 49
I think proper solution is enable crtc upon reconnection IF it is disabled.
Here is a prototype for patch - I'm hoping maintainer (Sean?)
can suggest "correct code" to enable crtc.
diff --git a/xfsettingsd/ displays. c b/xfsettingsd/ displays. c displays. c displays. c helper_ screen_ on_event (GdkXEvent *xevent,
index 095e323..af70256 100644
--- a/xfsettingsd/
+++ b/xfsettingsd/
@@ -415,6 +415,7 @@ xfce_displays_
XfceRROutput *output, *o;
XEvent *e = xevent;
gint event_num;
+ gint j;
guint n, m, nactive = 0;
gboolean found = FALSE, changed = FALSE;
@@ -496,9 +497,37 @@ xfce_displays_ helper_ screen_ on_event (GdkXEvent *xevent,
xfsettings_ dbg (XFSD_DEBUG_ DISPLAYS, "New output connected: %s",
output- >info-> name); DISPLAYS, "enabling crtc for %s", output- >info-> name); helper_ find_usable_ crtc (helper, output); >preferred_ mode; >resources- >nmode; ++j) >resources- >modes[ j].id == output- >preferred_ mode) >resources- >modes[ j].width; >resources- >modes[ j].height; helper_ set_outputs (crtc, output);
changed = TRUE; helper_ apply_all (helper); channel_ get_bool (helper->channel, NOTIFY_PROP, FALSE))
xfce_ spawn_command_ line_on_ screen (NULL, "xfce4- display- settings -m", FALSE,
{
+ /* need to enable crtc for output ? */
+ if (output->info->crtc == None)
+ {
+ xfsettings_dbg (XFSD_DEBUG_
+ crtc = xfce_displays_
+ if (crtc)
+ {
+ crtc->mode = output-
+ crtc->rotation = RR_Rotate_0;
+ crtc->x = crtc->y = 0;
+ /* set width and height */
+ for (j = 0; j < helper-
+ {
+ if (helper-
+ {
+ crtc->width = helper-
+ crtc->height = helper-
+ break;
+ }
+ }
+ xfce_displays_
+ crtc->changed = TRUE;
+ }
+ }
+
}
}
+ if (changed)
+ xfce_displays_
+
/* Start the minimal dialog according to the user preferences */
if (changed && xfconf_