handle xrandr properly (again) so u can change resolutions on the fly again,

gadman handles this right, and fix restart properly - well its half arsed
still, but works.


SVN revision: 13051
This commit is contained in:
Carsten Haitzler 2005-01-22 05:21:48 +00:00
parent 81c8839992
commit 2dd953e701
9 changed files with 100 additions and 19 deletions

View File

@ -362,7 +362,8 @@ _e_app_fields_fill(E_App *a, char *path)
/* if its "C" its the default - so drop it */
if ((lang) && (!strcmp(lang, "C")))
lang = NULL;
ef = eet_open(a->path, EET_FILE_MODE_READ);
if (!path) path = a->path;
ef = eet_open(path, EET_FILE_MODE_READ);
if (!ef) return;
if (lang)
@ -373,7 +374,6 @@ _e_app_fields_fill(E_App *a, char *path)
}
else
v = eet_read(ef, "app/info/name", &size);
if (v)
{
str = malloc(size + 1);

View File

@ -4,6 +4,7 @@
Ecore_X_Atom E_ATOM_MANAGED = 0;
Ecore_X_Atom E_ATOM_DESK = 0;
Ecore_X_Atom E_ATOM_ICONIC = 0;
Ecore_X_Atom E_ATOM_MAPPED = 0;
/* externally accessible functions */
int
@ -12,6 +13,7 @@ e_atoms_init(void)
E_ATOM_MANAGED = ecore_x_atom_get("__E_WINDOW_MANAGED");
E_ATOM_DESK = ecore_x_atom_get("__E_WINDOW_DESK");
E_ATOM_ICONIC = ecore_x_atom_get("__E_WINDOW_ICONIC");
E_ATOM_MAPPED = ecore_x_atom_get("__E_WINDOW_MAPPED");
return 1;
}

View File

@ -9,6 +9,7 @@ extern EAPI Ecore_X_Atom E_ATOM_MANAGED;
/* basic window properties */
extern EAPI Ecore_X_Atom E_ATOM_DESK;
extern EAPI Ecore_X_Atom E_ATOM_ICONIC;
extern EAPI Ecore_X_Atom E_ATOM_MAPPED;
EAPI int e_atoms_init(void);
EAPI int e_atoms_shutdown(void);

View File

@ -322,6 +322,7 @@ void
e_border_show(E_Border *bd)
{
E_Event_Border_Show *ev;
unsigned int visible;
E_OBJECT_CHECK(bd);
if (bd->visible) return;
@ -332,6 +333,9 @@ e_border_show(E_Border *bd)
bd->changed = 1;
bd->changes.visible = 1;
visible = 1;
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &visible, 1);
ev = calloc(1, sizeof(E_Event_Border_Show));
ev->border = bd;
/* SUSPICION: does the unref for this actually sometimes not get */
@ -344,6 +348,7 @@ void
e_border_hide(E_Border *bd)
{
E_Event_Border_Hide *ev;
unsigned int visible;
E_OBJECT_CHECK(bd);
if (!bd->visible) return;
@ -360,6 +365,9 @@ e_border_hide(E_Border *bd)
bd->changed = 1;
bd->changes.visible = 1;
visible = 0;
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &visible, 1);
ev = calloc(1, sizeof(E_Event_Border_Hide));
ev->border = bd;
/* SUSPICION: does the unref for this actually sometimes not get */
@ -804,6 +812,7 @@ e_border_iconify(E_Border *bd)
}
iconic = 1;
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_ICONIC, &iconic, 1);
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &iconic, 1);
}
void
@ -826,6 +835,7 @@ e_border_uniconify(E_Border *bd)
}
iconic = 0;
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_ICONIC, &iconic, 1);
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MAPPED, &iconic, 1);
}
void
@ -883,9 +893,6 @@ e_border_idler_before(void)
static void
_e_border_free(E_Border *bd)
{
ecore_x_window_prop_property_del(bd->client.win, E_ATOM_MANAGED);
ecore_x_window_prop_property_del(bd->client.win, E_ATOM_DESK);
ecore_x_window_prop_property_del(bd->client.win, E_ATOM_ICONIC);
while (bd->pending_move_resize)
{
free(bd->pending_move_resize->data);

View File

@ -378,11 +378,6 @@ _e_container_cb_bg_ecore_evas_resize(Ecore_Evas *ee)
evas_output_viewport_get(evas, NULL, NULL, &w, &h);
o = evas_object_name_find(evas, "desktop/background");
con = evas_object_data_get(o, "e_container");
/* FIXME: Handle resizing of zones if container is resized */
#if 0
evas_object_resize(con->bg_object, w, h);
evas_object_resize(con->bg_event_object, w, h);
#endif
_e_container_resize_handle(con);
}
@ -426,22 +421,60 @@ _e_container_resize_handle(E_Container *con)
{
E_Event_Container_Resize *ev;
Evas_List *l;
int n, i;
ev = calloc(1, sizeof(E_Event_Container_Resize));
ev->container = con;
/* FIXME: Handle resizing of zones if container is resized */
n = ecore_x_xinerama_screen_count_get();
if (n == 0)
{
if (con->zones)
{
E_Zone *zone;
zone = con->zones->data;
e_zone_move(zone, 0, 0);
e_zone_resize(zone, con->w, con->h);
}
}
else
{
for (i = 0; i < n; i++)
{
int zx, zy, zw, zh;
if (ecore_x_xinerama_screen_geometry_get(i, &zx, &zy, &zw, &zh))
{
E_Zone *zone;
zone = e_container_zone_number_get(con, i);
if (zone)
{
e_zone_move(zone, zx, zy);
e_zone_resize(zone, zw, zh);
}
}
}
}
e_gadman_container_resize(con->gadman);
e_object_ref(E_OBJECT(con));
ecore_event_add(E_EVENT_CONTAINER_RESIZE, ev, _e_container_event_container_resize_free, NULL);
for (l = con->clients; l; l = l->next)
{
E_Border *b;
E_Border *bd;
b = l->data;
bd = l->data;
if ((b->x + b->w) > con->w) e_border_move(b, con->w - b->w, b->y);
if (b->w > con->w) e_border_resize(b, con->w, b->h);
if ((b->y + b->h) > con->h) e_border_move(b, b->x, con->h - b->h);
if (b->h > con->h) e_border_resize(b, b->w, con->h);
if (bd->w > bd->zone->w)
e_border_resize(bd, bd->zone->w, bd->h);
if ((bd->x + bd->w) > (bd->zone->x + bd->zone->w))
e_border_move(bd, bd->zone->x + bd->zone->w - bd->w, bd->y);
if (bd->h > bd->zone->h)
e_border_resize(bd, bd->w, bd->zone->h);
if ((bd->y + bd->h) > (bd->zone->y + bd->zone->h))
e_border_move(bd, bd->x, bd->zone->y + bd->zone->h - bd->h);
}
}

View File

@ -135,6 +135,36 @@ e_gadman_mode_get(E_Gadman *gm)
return gm->mode;
}
void
e_gadman_container_resize(E_Gadman *gm)
{
Evas_List *l;
E_OBJECT_CHECK(gm);
for (l = gm->clients; l; l = l->next)
{
E_Gadman_Client *gmc;
gmc = l->data;
if (gmc->use_autow)
{
gmc->w = gmc->autow;
gmc->x = gmc->zone->x + ((gmc->zone->w - gmc->w) * gmc->ax);
}
if (gmc->use_autoh)
{
gmc->h = gmc->autoh;
gmc->y = gmc->zone->y + ((gmc->zone->h - gmc->h) * gmc->ay);
}
if (gmc->w > gmc->zone->w) gmc->w = gmc->zone->w;
if (gmc->h > gmc->zone->h) gmc->h = gmc->zone->h;
gmc->x = gmc->zone->x + ((gmc->zone->w - gmc->w) * gmc->ax);
gmc->y = gmc->zone->y + ((gmc->zone->h - gmc->h) * gmc->ay);
_e_gadman_client_overlap_deny(gmc);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
}
}
E_Gadman_Client *
e_gadman_client_new(E_Gadman *gm)
{
@ -669,6 +699,7 @@ _e_gadman_client_overlap_deny(E_Gadman_Client *gmc)
}
iterate++;
}
_e_gadman_client_geometry_to_align(gmc);
}
static void

View File

@ -86,6 +86,7 @@ EAPI int e_gadman_shutdown(void);
EAPI E_Gadman *e_gadman_new(E_Container *con);
EAPI void e_gadman_mode_set(E_Gadman *gm, E_Gadman_Mode mode);
EAPI E_Gadman_Mode e_gadman_mode_get(E_Gadman *gm);
EAPI void e_gadman_container_resize(E_Gadman *gm);
EAPI E_Gadman_Client *e_gadman_client_new(E_Gadman *gm);
EAPI void e_gadman_client_save(E_Gadman_Client *gmc);
EAPI void e_gadman_client_edge_set(E_Gadman_Client *gmc, E_Gadman_Edge edge);

View File

@ -257,7 +257,7 @@ _e_int_menus_apps_scan(E_Menu *m)
{
char buf[4096];
snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
snprintf(buf, sizeof(buf), "%s/.directory.eapp", a->path);
e_menu_item_icon_edje_set(mi, buf, "icon");
e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path));
app_count++;

View File

@ -543,7 +543,13 @@ _e_main_screens_init(void)
deskxy[1]);
e_border_desk_set(bd, target);
if (target == e_desk_current_get(bd->zone))
e_border_show(bd);
{
ret = ecore_x_window_prop_card32_get(windows[i],
E_ATOM_MAPPED,
&ret_val, 1);
if ((ret > -1) && ret_val)
e_border_show(bd);
}
}
}
ret = ecore_x_window_prop_card32_get(windows[i],