patches for some cleanups...

and i'm moving xinerama handling to 1 central place to fixup bugs in xinerama
detection. its not complete.


SVN revision: 13643
This commit is contained in:
Carsten Haitzler 2005-03-07 07:27:52 +00:00
parent a1edb45248
commit 3cece5b86b
6 changed files with 145 additions and 72 deletions

1
TODO
View File

@ -29,6 +29,7 @@ Current freeze issues are:
ISSUES:
* borders raise/lower stack doesnt modify any list to track stacking
* consoldiate client lists - we have client lists for containers, zones, desks AND e_borders.c consolidate into 1 list that has all borders with their stacking and what desk they belong to (and thus zone and container)
* focus newly created windows when appropriate (under mouse and focus follows mouse etc.)
* focus issues in general

View File

@ -41,7 +41,8 @@ e_startup.h \
e_iconify.h \
e_hints.h \
e_gadman.h \
e_signals.h
e_signals.h \
e_xinerama.h
enlightenment_SOURCES = \
@ -77,6 +78,7 @@ e_iconify.c \
e_hints.c \
e_gadman.c \
e_signals.c \
e_xinerama.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@

View File

@ -32,3 +32,4 @@
#include "e_hints.h"
#include "e_gadman.h"
#include "e_signals.h"
#include "e_xinerama.h"

View File

@ -256,9 +256,15 @@ main(int argc, char **argv)
else
_e_main_shutdown_push(_e_main_ipc_shutdown);
/* setup module loading etc. FIXME: check return value */
e_module_init();
/* setup module loading etc */
if (!e_module_init())
{
e_error_message_show("Enlightenment cannot set up its module system.");
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_module_shutdown);
/* setup iconification */
if (!e_iconify_init())
{
e_error_message_show("Enlightenment cannot setup its iconify system.");
@ -289,7 +295,7 @@ main(int argc, char **argv)
/* add in a handler that just before we go idle we flush x */
_e_main_idle_enterer_flusher = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
/* an intle enterer to be called after all others */
/* an idle enterer to be called after all others */
_e_main_idle_enterer_after = ecore_idle_enterer_add(_e_main_cb_idler_after, NULL);
ecore_x_ungrab();
@ -323,7 +329,6 @@ main(int argc, char **argv)
/* NB: no need to do this as config shutdown will flush any saves */
/* and all changed config was already saved before */
e_config_save_flush();
e_module_shutdown();
/* unroll our stack of shutdown functions with exit code of 0 */
_e_main_shutdown(0);
@ -340,7 +345,7 @@ main(int argc, char **argv)
return 0;
}
/* FIXME: make save to deleet within a callback */
/* FIXME: make save to delete within a callback */
E_Before_Idler *
e_main_idler_before_add(int (*func) (void *data), void *data, int once)
{
@ -457,7 +462,7 @@ _e_main_dirs_init(void)
/* err dont just disable it - replace it with a proper wizard tool */
/* outside e's main source to populate these directories from gnome/kde */
/* app menu data etc. */
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/eterm.eapp", homedir);
snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/.order", homedir);
if (!ecore_file_exists(buf))
{
printf("GETTING YOU STARTED!\n");
@ -485,6 +490,7 @@ _e_main_screens_init(void)
Ecore_X_Window *roots;
int num, i;
if (!e_xinerama_init()) return 0;
if (!e_atoms_init()) return 0;
if (!e_manager_init()) return 0;
if (!e_container_init()) return 0;
@ -530,69 +536,6 @@ _e_main_screens_init(void)
i);
return 0;
}
/* FIXME
* This should be removed!
{
E_Gadman_Client *gmc;
gmc = e_gadman_client_new(con->gadman);
gmc->x = 0;
gmc->y = 300;
gmc->w = 100;
gmc->h = 100;
e_gadman_client_policy_set(gmc,
// E_GADMAN_POLICY_EDGES |
E_GADMAN_POLICY_ANYWHERE |
E_GADMAN_POLICY_HMOVE |
E_GADMAN_POLICY_VMOVE |
E_GADMAN_POLICY_HSIZE |
E_GADMAN_POLICY_VSIZE);
e_gadman_client_min_size_set(gmc, 20, 20);
e_gadman_client_auto_size_set(gmc, 50, 200);
e_gadman_client_align_set(gmc, 0.0, 0.5);
e_client_gadman_edge_set(gmc, E_GADMAN_EDGE_LEFT);
e_gadman_client_domain_set(gmc, "test", 0);
e_gadman_client_load(gmc);
gmc = e_gadman_client_new(con->gadman);
gmc->x = 0;
gmc->y = 400;
gmc->w = 100;
gmc->h = 100;
e_gadman_client_policy_set(gmc,
// E_GADMAN_POLICY_EDGES |
E_GADMAN_POLICY_ANYWHERE |
E_GADMAN_POLICY_HMOVE |
E_GADMAN_POLICY_VMOVE |
E_GADMAN_POLICY_HSIZE |
E_GADMAN_POLICY_VSIZE);
e_gadman_client_min_size_set(gmc, 20, 20);
e_gadman_client_auto_size_set(gmc, 50, 200);
e_gadman_client_align_set(gmc, 0.0, 0.5);
e_client_gadman_edge_set(gmc, E_GADMAN_EDGE_LEFT);
e_gadman_client_domain_set(gmc, "test", 1);
e_gadman_client_load(gmc);
gmc = e_gadman_client_new(con->gadman);
gmc->x = 0;
gmc->y = 500;
gmc->w = 100;
gmc->h = 100;
e_gadman_client_policy_set(gmc,
// E_GADMAN_POLICY_EDGES |
E_GADMAN_POLICY_ANYWHERE |
E_GADMAN_POLICY_HMOVE |
E_GADMAN_POLICY_VMOVE |
E_GADMAN_POLICY_HSIZE |
E_GADMAN_POLICY_VSIZE);
e_gadman_client_min_size_set(gmc, 20, 20);
e_gadman_client_auto_size_set(gmc, 50, 200);
e_gadman_client_align_set(gmc, 0.0, 0.5);
e_client_gadman_edge_set(gmc, E_GADMAN_EDGE_LEFT);
e_gadman_client_domain_set(gmc, "test", 2);
e_gadman_client_load(gmc);
}
*/
}
free(roots);
ecore_x_sync();
@ -611,6 +554,7 @@ _e_main_screens_shutdown(void)
e_container_shutdown();
e_manager_shutdown();
e_atoms_shutdown();
e_xinerama_shutdown();
return 1;
}
@ -813,4 +757,3 @@ _e_main_cb_startup_fake_end(void *data)
e_init_hide();
return 0;
}

104
src/bin/e_xinerama.c Normal file
View File

@ -0,0 +1,104 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
static void _e_xinerama_clean(void);
static void _e_xinerama_update(void);
static Evas_List *all_screens = NULL;
static Evas_List *chosen_screens = NULL;
int
e_xinerama_init(void)
{
_e_xinerama_update();
return 1;
}
int
e_xinerama_shutdown(void)
{
_e_xinerama_clean();
return 1;
}
static void
_e_xinerama_clean(void)
{
while (all_screens)
{
free(all_screens->data);
all_screens = evas_list_remove_list(all_screens, all_screens);
}
while (chosen_screens)
{
free(chosen_screens->data);
chosen_screens = evas_list_remove_list(chosen_screens, chosen_screens);
}
}
static void
_e_xinerama_update(void)
{
int i, n;
Ecore_X_Window root, *roots;
_e_xinerama_clean();
roots = ecore_x_window_root_list(&n);
if (roots)
{
int rw, rh;
/* more than 1 root window - xinerama wont be active */
if (n > 1)
{
free(roots);
return;
}
/* first (and only) root window */
root = roots[0];
free(roots);
/* get root size */
ecore_x_window_size_get(root, &rw, &rh);
/* get number of xinerama screens */
n = ecore_x_xinerama_screen_count_get();
if (n < 1)
{
E_Screen *scr;
scr = calloc(1, sizeof(E_Screen));
scr->screen = 0;
scr->x = 0;
scr->y = 0;
scr->w = rw;
scr->h = rh;
all_screens = evas_list_append(all_screens, scr);
}
else
{
for (i = 0; i < n; i++)
{
int x, y, w, h;
/* get each xinerama screen geometry */
if (ecore_x_xinerama_screen_geometry_get(i, &x, &y, &w, &h))
{
E_Screen *scr;
printf("E17 INIT: XINERAMA SCREEN: [%i], %ix%i+%i+%i\n",
i, w, h, x, y);
/* add it to our list */
scr = calloc(1, sizeof(E_Screen));
scr->screen = i;
scr->x = x;
scr->y = y;
scr->w = w;
scr->h = h;
all_screens = evas_list_append(all_screens, scr);
}
}
}
}
/* now go through all_screens... and build a list of chosen screens */
}

22
src/bin/e_xinerama.h Normal file
View File

@ -0,0 +1,22 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
typedef struct _E_Screen E_Screen;
#else
#ifndef E_XINERAMA_H
#define E_XINERAMA_H
struct _E_Screen
{
int screen;
int x, y, w, h;
};
EAPI int e_xinerama_init(void);
EAPI int e_xinerama_shutdown(void);
#endif
#endif