summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2012-07-02 12:49:51 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2012-07-02 12:49:51 +0000
commit3275e03aa5d53ceee8f939df28468848bf6f64ac (patch)
tree8f1da5ce22735f3b5e6b337fec24acdc780a838b /src/bin
parent958f8a340c82cbd0f8a1df681ac264a7daa9467c (diff)
terminology: better handling of position
SVN revision: 73163
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 52ea464..c7ce5db 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -290,7 +290,7 @@ elm_main(int argc, char **argv)
290 config->mute = video_mute; 290 config->mute = video_mute;
291 config->temporary = EINA_TRUE; 291 config->temporary = EINA_TRUE;
292 } 292 }
293 293
294 if (geometry) 294 if (geometry)
295 { 295 {
296 if (sscanf(geometry,"%ix%i+%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 296 if (sscanf(geometry,"%ix%i+%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4)
@@ -300,16 +300,20 @@ elm_main(int argc, char **argv)
300 } 300 }
301 else if (sscanf(geometry,"%ix%i-%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 301 else if (sscanf(geometry,"%ix%i-%i+%i", &size_w, &size_h, &pos_x, &pos_y) == 4)
302 { 302 {
303 pos_x = -pos_x;
303 pos_set = 1; 304 pos_set = 1;
304 size_set = 1; 305 size_set = 1;
305 } 306 }
306 else if (sscanf(geometry,"%ix%i-%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 307 else if (sscanf(geometry,"%ix%i-%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4)
307 { 308 {
309 pos_x = -pos_x;
310 pos_y = -pos_y;
308 pos_set = 1; 311 pos_set = 1;
309 size_set = 1; 312 size_set = 1;
310 } 313 }
311 else if (sscanf(geometry,"%ix%i+%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4) 314 else if (sscanf(geometry,"%ix%i+%i-%i", &size_w, &size_h, &pos_x, &pos_y) == 4)
312 { 315 {
316 pos_y = -pos_y;
313 pos_set = 1; 317 pos_set = 1;
314 size_set = 1; 318 size_set = 1;
315 } 319 }
@@ -323,14 +327,18 @@ elm_main(int argc, char **argv)
323 } 327 }
324 else if (sscanf(geometry,"-%i+%i", &pos_x, &pos_y) == 2) 328 else if (sscanf(geometry,"-%i+%i", &pos_x, &pos_y) == 2)
325 { 329 {
330 pos_x = -pos_x;
326 pos_set = 1; 331 pos_set = 1;
327 } 332 }
328 else if (sscanf(geometry,"+%i-%i", &pos_x, &pos_y) == 2) 333 else if (sscanf(geometry,"+%i-%i", &pos_x, &pos_y) == 2)
329 { 334 {
335 pos_y = -pos_y;
330 pos_set = 1; 336 pos_set = 1;
331 } 337 }
332 else if (sscanf(geometry,"-%i-%i", &pos_x, &pos_y) == 2) 338 else if (sscanf(geometry,"-%i-%i", &pos_x, &pos_y) == 2)
333 { 339 {
340 pos_x = -pos_x;
341 pos_y = -pos_y;
334 pos_set = 1; 342 pos_set = 1;
335 } 343 }
336 } 344 }
@@ -339,7 +347,7 @@ elm_main(int argc, char **argv)
339 size_w = 80; 347 size_w = 80;
340 size_h = 24; 348 size_h = 24;
341 } 349 }
342 350
343 // set an env so terminal apps can detect they are in terminology :) 351 // set an env so terminal apps can detect they are in terminology :)
344 putenv("TERMINOLOGY=1"); 352 putenv("TERMINOLOGY=1");
345 353
@@ -351,7 +359,7 @@ elm_main(int argc, char **argv)
351 { 359 {
352 if (fullscreen) elm_win_fullscreen_set(win, EINA_TRUE); 360 if (fullscreen) elm_win_fullscreen_set(win, EINA_TRUE);
353 } 361 }
354 362
355 conform = o = elm_conformant_add(win); 363 conform = o = elm_conformant_add(win);
356 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 364 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
357 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 365 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -371,7 +379,14 @@ elm_main(int argc, char **argv)
371 elm_object_content_set(conform, o); 379 elm_object_content_set(conform, o);
372 evas_object_show(o); 380 evas_object_show(o);
373 381
374 if (pos_set) evas_object_move(win, pos_x, pos_y); 382 if (pos_set)
383 {
384 int screen_w, screen_h;
385 elm_win_screen_size_get(win, NULL, NULL, &screen_w, &screen_h);
386 if (pos_x < 0) pos_x = screen_w + pos_x;
387 if (pos_y < 0) pos_y = screen_h + pos_y;
388 evas_object_move(win, pos_x, pos_y);
389 }
375 390
376 term = o = termio_add(win, config, cmd, size_w, size_h); 391 term = o = termio_add(win, config, cmd, size_w, size_h);
377 termio_win_set(o, win); 392 termio_win_set(o, win);