{
zones = e_comp->zones;
e_comp->zones = NULL;
+ printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
EINA_LIST_FOREACH(screens, l, scr)
{
zone = NULL;
+ printf("@ match screens %p[%i] = %i %i %ix%i -- %i\n",
+ scr, scr->escreen, scr->x, scr->y, scr->w, scr->h, scr->escreen);
EINA_LIST_FOREACH(zones, ll, zone)
{
if (zone->id == scr->escreen) break;
zone = NULL;
}
+ printf("@ matches existing zone %p\n", zone);
if (zone)
{
+ printf(" move resize %i %i %ix%i -> %i %i %ix%i\n",
+ zone->x, zone->y, zone->w, zone->h,
+ scr->x, scr->y, scr->w, scr->h);
changed |= e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h);
if (changed)
printf("@@@ FOUND ZONE %i %i [%p]\n", zone->num, zone->id, zone);
{
E_Zone *spare_zone;
+ printf("@zones have been deleted....\n");
changed = EINA_TRUE;
spare_zone = eina_list_data_get(e_comp->zones);
{
E_Client *ec;
+ printf("reassign all clients from deleted zone %p\n", zone);
E_CLIENT_FOREACH(e_comp, ec)
{
if (ec->zone == zone)
screen->w = s->config.geom.w;
screen->h = s->config.geom.h;
all_screens = eina_list_append(all_screens, screen);
+ printf("xinerama screen %i %i %ix%i\n", screen->x, screen->y, screen->w, screen->h);
INF("E INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i",
i, i, screen->w, screen->h, screen->x, screen->y);
i++;
}
}
- // XXX: what if we have zero screens? all unplugged? need to flag this
- // keep all screens as-is for now and mark comp to hide everything
- // and wait for a screen to come back
- if (i == 0)
+ // if we have NO screens at all (above - i will be 0) AND we have no
+ // existing screens set up in xinerama - then just say root window size
+ // is the entire screen. this should handle the case where you unplug ALL
+ // screens from an existing setup (unplug external monitors and/or close
+ // laptop lid), in which case as long as at least one screen is configured
+ // in xinerama, it will be left-as is until next time we re-eval screen
+ // setup and have at least one screen
+ printf("xinerama setup............... %i %p\n", i, e_xinerama_screens_all_get());
+ if ((i == 0) && (!e_xinerama_screens_all_get()))
{
screen = E_NEW(E_Screen, 1);
screen->escreen = screen->screen = 0;
static Eina_Bool
_screen_closed(E_Randr2_Screen *s)
{
+ printf("RRR: check lid for %s...\n", s->info.name);
if (!_lid_is_closed) return EINA_FALSE;
- if (s->info.is_lid) return EINA_TRUE;
+ if (s->info.is_lid)
+ {
+ printf("RRR: is closed lid\n");
+ return EINA_TRUE;
+ }
return EINA_FALSE;
}
eina_strbuf_append(buf, ":");
eina_strbuf_append(buf, s->id);
eina_strbuf_append(buf, ":");
+ if (s->info.lid_closed) eina_strbuf_append(buf, ":LC:");
+ else eina_strbuf_append(buf, ":LO:");
}
}
str = eina_strbuf_string_steal(buf);
s1 = _screens_fingerprint(r1);
s2 = _screens_fingerprint(r2);
if ((!s1) && (!s2)) return EINA_FALSE;
+ printf("RRR: check fingerprint...\n");
if ((s1) && (s2) && (strcmp(s1, s2))) changed = EINA_TRUE;
+ printf("RRR: ... fingerprint says %i\n", changed);
free(s1);
free(s2);
// check screen config
(s->config.mode.w != ss->config.mode.w) ||
(s->config.mode.h != ss->config.mode.h) ||
(s->config.enabled != ss->config.enabled) ||
- (s->config.rotation != ss->config.rotation))
+ (s->config.rotation != ss->config.rotation) ||
+ (s->info.lid_closed != ss->info.lid_closed))
changed = EINA_TRUE;
}
+ printf("RRR: changed = %i\n", changed);
return changed;
}
_cb_screen_change_delay(void *data EINA_UNUSED)
{
_screen_delay_timer = NULL;
+ printf("RRR: ... %i %i\n", event_screen, event_ignore);
// if we had a screen plug/unplug etc. event and we shouldnt ignore it...
if ((event_screen) && (!event_ignore))
{
if (_screens_differ(e_randr2, rtemp)) change = EINA_TRUE;
_info_free(rtemp);
}
+ printf("RRR: change = %i\n", change);
// we plugged or unplugged some monitor - re-apply config so
// known screens can be coonfigured
if (change) e_randr2_config_apply();
E_Event_Acpi *ev = event;
Eina_Bool lid_closed;
+ printf("RRR: acpi event\n");
if (ev->type != E_ACPI_TYPE_LID) return EINA_TRUE;
lid_closed = (ev->status == E_ACPI_LID_CLOSED);
if (lid_closed == _lid_is_closed) return EINA_TRUE;
+ printf("RRR: lid event for lid %i\n", lid_closed);
_lid_is_closed = lid_closed;
+ event_screen = EINA_TRUE;
_screen_change_delay();
return EINA_TRUE;
}
{
E_Randr2_Screen *s2 = NULL;
- _config_do_recurse++;
- if (_config_do_recurse > 20)
+ printf("RRR: screen do '%s'\n", s->info.name);
+ if (_config_do_recurse > 10)
{
ERR("screen config loop!");
return;
}
+ _config_do_recurse++;
// if screen has a dependency...
if ((s->config.relative.mode != E_RANDR2_RELATIVE_UNKNOWN) &&
(s->config.relative.mode != E_RANDR2_RELATIVE_NONE) &&
s->config.geom.y = s2->config.geom.y + s2->config.geom.h;
}
}
+ _config_do_recurse--;
}
static void
else if (conn == ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_DISPLAY_PORT)
s->info.connector = E_RANDR2_CONNECTOR_DISPLAY_PORT;
s->info.is_lid = _is_lid_name(s->info.name);
+ s->info.lid_closed = s->info.is_lid && _lid_is_closed;
+ printf("RRR: .... lid_closed = %i (%i && %i)\n", s->info.lid_closed, s->info.is_lid, _lid_is_closed);
if (ecore_x_randr_output_connection_status_get(root, outputs[i]) ==
ECORE_X_RANDR_CONNECTION_STATUS_CONNECTED)
s->info.connected = EINA_TRUE;
Ecore_X_Randr_Crtc *crtcs = NULL;
Ecore_X_Randr_Output *outputs = NULL, out, *outconf;
E_Randr2_Screen **screenconf;
- int crtcs_num = 0, outputs_num = 0, i;
+ int crtcs_num = 0, outputs_num = 0, i, numout;
Ecore_X_Randr_Crtc_Info *info;
int top_priority = 0;
}
}
}
+ numout = 0;
+ for (i = 0; i < crtcs_num; i++)
+ {
+ if (outconf[i]) numout++;
+ }
+ if (numout)
+ {
// set up a crtc to drive each output (or not)
for (i = 0; i < crtcs_num; i++)
{
ECORE_X_RANDR_ORIENTATION_ROT_0);
}
}
+ }
+ else
+ {
+ printf("RRR: EERRRRRROOOORRRRRRR no outputs to configure!\n");
+ }
}
free(outputs);
free(crtcs);
+ printf("RRR: set vsize: %ix%i\n", nw, nh);
ecore_x_randr_screen_current_size_set(root, nw, nh, -1, -1);
{
int ww = 0, hh = 0, ww2 = 0, hh2 = 0;
ecore_x_randr_screen_current_size_get(root, &ww, &hh, &ww2, &hh2);
printf("RRR: cur size: %ix%i\n", ww, hh);
+// ecore_x_randr_screen_reset(root);
+// ecore_x_randr_screen_current_size_set(root, nw, nh, -1, -1);
+// ecore_x_sync();
+// ecore_x_randr_screen_current_size_get(root, &ww, &hh, &ww2, &hh2);
+// printf("RRR: cur size: %ix%i\n", ww, hh);
}
ecore_x_randr_screen_size_range_get(root, NULL, NULL, NULL, NULL);
ecore_x_ungrab();
ecore_x_sync();
// ignore the next batch of randr events - we caused them ourselves
- event_ignore = EINA_TRUE;
+ // XXX: a problem. thew first time we configure the screen we may not
+ // get any events back to clear the ignore flag below, so only apply
+ // here if the randr config now doesnt match what we want to set up.
+// event_ignore = EINA_TRUE;
}
E_Randr2_Screen *s = _screen_config_id_find(cs2->id);
if (s)
{
+ printf("SEt to %p [%s]\n", cs, cs->id);
printf("find s = %p\n", s);
printf("s id = %s\n", s->id);
elm_object_text_set(obj, s->info.name);
E_Config_Randr2_Screen *cs, *cs2;
e_randr2_cfg->restore = cfdata->restore;
+ printf("APPLY....................\n");
EINA_LIST_FOREACH(cfdata->screens, l, cs2)
{
if (!cs2->id) continue;
+ printf("APPLY .... %p\n", cs2);
cs = _screen_config_randr_id_find(cs2->id);
if (!cs)
{
}
if (cs->rel_to) eina_stringshare_del(cs->rel_to);
cs->rel_to = NULL;
+ printf("APPLY %s .... rel to %s\n", cs->id, cs2->rel_to);
if (cs2->rel_to) cs->rel_to = eina_stringshare_add(cs2->rel_to);
cs->rel_align = cs2->rel_align;
cs->mode_refresh = cs2->mode_refresh;
cs->rotation = cs2->rotation;
cs->priority = cs2->priority;
cs->rel_mode = cs2->rel_mode;
+ printf("APPLY %s .... rel mode %i\n", cs->id, cs->rel_mode);
cs->enabled = cs2->enabled;
}
e_randr2_config_save();