summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-06-18 20:12:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-06-18 20:12:04 +0900
commitac874ffe6254d85bd0a5c05d99c8fa573d04d9d5 (patch)
tree0486d3b6d16cb6ddcac7c13c24b79c7b3ba86dbb
parente9766c6bb9923b057b7f9688de1d70901a862e93 (diff)
elm confiug - remove now useless x11 property handling - donr by files
follow on from b1c5de0b9aa67b9d5cc4722e9462830beb3af37b, aa7f859da10ce007a7b945a8703e70161c96146d
-rw-r--r--src/lib/elm_config.c117
1 files changed, 1 insertions, 116 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index b4920ab1f..b82334622 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -125,61 +125,6 @@ static void _color_overlays_cancel(void);
125#define ELM_CONFIG_LIST(edd, type, member, eddtype) \ 125#define ELM_CONFIG_LIST(edd, type, member, eddtype) \
126 EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype) 126 EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)
127 127
128#ifdef HAVE_ELEMENTARY_X
129static Ecore_Event_Handler *_prop_change_handler = NULL;
130static Ecore_Timer *_prop_change_delay_timer = NULL;
131static Ecore_X_Window _config_win = 0;
132#define ATOM_COUNT 3
133static Ecore_X_Atom _atom[ATOM_COUNT];
134static const char *_atom_names[ATOM_COUNT] =
135{
136 "ELM_PROFILE",
137 "ELM_CONFIG",
138 "ELM_CONFIG_WIN"
139};
140#define ATOM_E_PROFILE 0
141#define ATOM_E_CONFIG 1
142#define ATOM_E_CONFIG_WIN 2
143
144static Eina_Bool
145_prop_change_delay_cb(void *data EINA_UNUSED)
146{
147 char *s;
148
149 if (!getenv("ELM_PROFILE"))
150 {
151 s = ecore_x_window_prop_string_get(_config_win, _atom[ATOM_E_PROFILE]);
152 if (s)
153 {
154 free(_elm_profile);
155 _elm_profile = s;
156 }
157 }
158 _config_get();
159 _prop_change_delay_timer = NULL;
160
161 return ECORE_CALLBACK_CANCEL;
162}
163
164static Eina_Bool
165_prop_change(void *data EINA_UNUSED,
166 int ev_type EINA_UNUSED,
167 void *ev)
168{
169 Ecore_X_Event_Window_Property *event = ev;
170
171 if (event->win == _config_win)
172 {
173 if (event->atom == _atom[ATOM_E_PROFILE])
174 {
175 ecore_timer_del(_prop_change_delay_timer);
176 _prop_change_delay_timer = ecore_timer_add(0.1, _prop_change_delay_cb, NULL);
177 }
178 }
179 return ECORE_CALLBACK_PASS_ON;
180}
181#endif
182
183static void 128static void
184_elm_font_overlays_del_free(void) 129_elm_font_overlays_del_free(void)
185{ 130{
@@ -3118,12 +3063,6 @@ EAPI void
3118elm_config_all_flush(void) 3063elm_config_all_flush(void)
3119{ 3064{
3120 FILE *f; 3065 FILE *f;
3121
3122#ifdef HAVE_ELEMENTARY_X
3123 if (ecore_x_display_get())
3124 ecore_x_window_prop_string_set(_config_win, _atom[ATOM_E_PROFILE],
3125 _elm_profile);
3126#endif
3127 char buf[PATH_MAX]; 3066 char buf[PATH_MAX];
3128 3067
3129 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/flush", 3068 _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/flush",
@@ -3187,7 +3126,6 @@ void
3187_elm_config_sub_shutdown(void) 3126_elm_config_sub_shutdown(void)
3188{ 3127{
3189#ifdef HAVE_ELEMENTARY_X 3128#ifdef HAVE_ELEMENTARY_X
3190 ELM_SAFE_FREE(_prop_change_delay_timer, ecore_timer_del);
3191 if (ecore_x_display_get()) ecore_x_shutdown(); 3129 if (ecore_x_display_get()) ecore_x_shutdown();
3192#endif 3130#endif
3193 ELM_SAFE_FREE(_eio_monitor, eio_monitor_del); 3131 ELM_SAFE_FREE(_eio_monitor, eio_monitor_del);
@@ -3251,59 +3189,9 @@ _elm_config_sub_init(void)
3251 else /* No $DISPLAY */ 3189 else /* No $DISPLAY */
3252 init_x = EINA_FALSE; 3190 init_x = EINA_FALSE;
3253 } 3191 }
3254
3255 if (init_x) 3192 if (init_x)
3256 { 3193 {
3257 if (ecore_x_init(NULL)) 3194 ecore_x_init(NULL);
3258 {
3259 Ecore_X_Window win = 0, win2 = 0, root;
3260
3261 if (!ecore_x_screen_is_composited(0))
3262 _elm_config->compositing = 0;
3263 ecore_x_atoms_get(_atom_names, ATOM_COUNT, _atom);
3264 root = ecore_x_window_root_first_get();
3265 if (ecore_x_window_prop_window_get(root,
3266 _atom[ATOM_E_CONFIG_WIN],
3267 &win, 1) == 1)
3268 {
3269 if (ecore_x_window_prop_window_get(win,
3270 _atom[ATOM_E_CONFIG_WIN],
3271 &win2, 1) == 1)
3272 {
3273 if (win2 == win) _config_win = win;
3274 }
3275 }
3276 if (_config_win == 0)
3277 _config_win = ecore_x_window_permanent_new
3278 (root, _atom[ATOM_E_CONFIG_WIN]);
3279
3280 ecore_x_event_mask_set(_config_win,
3281 ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
3282 _prop_change_handler = ecore_event_handler_add
3283 (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, NULL);
3284 if (!getenv("ELM_PROFILE"))
3285 {
3286 char *s;
3287
3288 s = ecore_x_window_prop_string_get(_config_win,
3289 _atom[ATOM_E_PROFILE]);
3290 if (s)
3291 {
3292 int changed = 0;
3293
3294 if (_elm_profile)
3295 {
3296 if (strcmp(_elm_profile, s)) changed = 1;
3297 free(_elm_profile);
3298 }
3299 _elm_profile = s;
3300 if (changed) _config_get();
3301 s = strchr(_elm_profile, '/');
3302 if (s) *s = 0;
3303 }
3304 }
3305 }
3306 else ERR("Cannot connect to X11 display. check $DISPLAY variable");
3307 } 3195 }
3308#endif 3196#endif
3309#ifdef HAVE_ELEMENTARY_WAYLAND 3197#ifdef HAVE_ELEMENTARY_WAYLAND
@@ -3558,9 +3446,6 @@ _elm_config_profile_set(const char *profile)
3558void 3446void
3559_elm_config_shutdown(void) 3447_elm_config_shutdown(void)
3560{ 3448{
3561#ifdef HAVE_ELEMENTARY_X
3562 ELM_SAFE_FREE(_prop_change_handler, ecore_event_handler_del);
3563#endif
3564 ELM_SAFE_FREE(_elm_config, _config_free); 3449 ELM_SAFE_FREE(_elm_config, _config_free);
3565 ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del); 3450 ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del);
3566 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del); 3451 ELM_SAFE_FREE(_elm_accel_preference, eina_stringshare_del);