summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-26 08:34:24 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-07-26 08:34:24 +0000
commit8a7f7aa9e1027a25a55f0183a07c770a2e88df4f (patch)
tree2e750010a623ecc4d9624e64c397aeb93b48f846
parent24c0609d534278722b2f05d3ce0e4aa7cc21350f (diff)
optimize root window size calculation thanks to the devilhorns school of how to program less suckily
SVN revision: 61734
-rw-r--r--ev.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/ev.c b/ev.c
index 35ae808..dcd5ac9 100644
--- a/ev.c
+++ b/ev.c
@@ -185,8 +185,7 @@ int
185main(int argc, char *argv[]) 185main(int argc, char *argv[])
186{ 186{
187 Evas_Object *listwin, *win, *bg, *box; 187 Evas_Object *listwin, *win, *bg, *box;
188 int num_wins, nw; 188 Ecore_X_Window zw;
189 Ecore_X_Window zw, zwr, *roots;
190 189
191 itc.item_style = "default"; 190 itc.item_style = "default";
192 itc.func.label_get = _label; 191 itc.func.label_get = _label;
@@ -220,21 +219,10 @@ main(int argc, char *argv[])
220 evas_object_show(win); 219 evas_object_show(win);
221 220
222 zw = elm_win_xwindow_get(win); 221 zw = elm_win_xwindow_get(win);
223 zwr = ecore_x_window_root_get(zw); 222 if (zw)
224 roots = ecore_x_window_root_list(&num_wins); 223 ecore_x_randr_screen_current_size_get(ecore_x_window_root_get(zw), &root_x, &root_y, NULL, NULL);
225 if ((!roots) || (num_wins <= 0))
226 ERR("Could not determine screen size; autoscaling disabled");
227 else 224 else
228 { 225 ERR("Could not determine screen size; autoscaling disabled");
229 for (nw = 0; nw < num_wins; nw++)
230 {
231 if (roots[nw] != zwr) continue;
232
233 ecore_x_window_size_get(zwr, &root_x, &root_y);
234 break;
235 }
236 free(roots);
237 }
238 226
239 listwin = elm_win_add(NULL, "ev", ELM_WIN_BASIC); 227 listwin = elm_win_add(NULL, "ev", ELM_WIN_BASIC);
240 elm_win_autodel_set(listwin, EINA_TRUE); 228 elm_win_autodel_set(listwin, EINA_TRUE);