diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c | 455 |
1 files changed, 290 insertions, 165 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c index 7d3af12..6dd13de 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_x.c | |||
@@ -20,6 +20,22 @@ static int leader_ref = 0; | |||
20 | static Ecore_X_Window leader_win = 0; | 20 | static Ecore_X_Window leader_win = 0; |
21 | 21 | ||
22 | static void | 22 | static void |
23 | _ecore_evas_x_hints_update(Ecore_Evas *ee) | ||
24 | { | ||
25 | ecore_x_icccm_hints_set | ||
26 | (ee->prop.window, | ||
27 | !ee->prop.focus_skip /* accepts_focus */, | ||
28 | ee->prop.iconified ? ECORE_X_WINDOW_STATE_HINT_ICONIC : | ||
29 | ee->prop.withdrawn ? ECORE_X_WINDOW_STATE_HINT_WITHDRAWN : | ||
30 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
31 | 0 /* icon_pixmap */, | ||
32 | 0 /* icon_mask */, | ||
33 | 0 /* icon_window */, | ||
34 | ee->prop.group_ee_win /* window_group */, | ||
35 | ee->prop.urgent /* is_urgent */); | ||
36 | } | ||
37 | |||
38 | static void | ||
23 | _ecore_evas_x_group_leader_set(Ecore_Evas *ee) | 39 | _ecore_evas_x_group_leader_set(Ecore_Evas *ee) |
24 | { | 40 | { |
25 | leader_ref++; | 41 | leader_ref++; |
@@ -537,6 +553,7 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
537 | { | 553 | { |
538 | Ecore_Evas *ee; | 554 | Ecore_Evas *ee; |
539 | Ecore_X_Event_Window_Property *e; | 555 | Ecore_X_Event_Window_Property *e; |
556 | int state_change = 0; | ||
540 | 557 | ||
541 | e = event; | 558 | e = event; |
542 | ee = ecore_event_window_match(e->win); | 559 | ee = ecore_event_window_match(e->win); |
@@ -546,20 +563,62 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
546 | { | 563 | { |
547 | unsigned int i, num; | 564 | unsigned int i, num; |
548 | Ecore_X_Window_State *state; | 565 | Ecore_X_Window_State *state; |
549 | int sticky = 0; | 566 | struct { |
550 | 567 | struct { | |
551 | /* TODO: we need to move those to the end, with if statements */ | 568 | unsigned char modal : 1; |
552 | ee->engine.x.state.modal = 0; | 569 | unsigned char sticky : 1; |
553 | ee->engine.x.state.maximized_v = 0; | 570 | unsigned char maximized_v : 1; |
554 | ee->engine.x.state.maximized_h = 0; | 571 | unsigned char maximized_h : 1; |
555 | ee->engine.x.state.shaded = 0; | 572 | unsigned char shaded : 1; |
573 | unsigned char skip_taskbar : 1; | ||
574 | unsigned char skip_pager : 1; | ||
575 | unsigned char fullscreen : 1; | ||
576 | unsigned char above : 1; | ||
577 | unsigned char below : 1; | ||
578 | } x; | ||
579 | struct { | ||
580 | char modal : 1; | ||
581 | char maximized : 1; | ||
582 | char sticky : 1; | ||
583 | char fullscreen : 1; | ||
584 | char focus_skip : 1; | ||
585 | } prop; | ||
586 | } prev; | ||
587 | |||
588 | prev.x.modal = ee->engine.x.state.modal; | ||
589 | prev.x.sticky = ee->engine.x.state.sticky; | ||
590 | prev.x.maximized_v = ee->engine.x.state.maximized_v; | ||
591 | prev.x.maximized_h = ee->engine.x.state.maximized_h; | ||
592 | prev.x.shaded = ee->engine.x.state.shaded; | ||
593 | prev.x.skip_taskbar = ee->engine.x.state.skip_taskbar; | ||
594 | prev.x.skip_pager = ee->engine.x.state.skip_pager; | ||
595 | prev.x.fullscreen = ee->engine.x.state.fullscreen; | ||
596 | prev.x.above = ee->engine.x.state.above; | ||
597 | prev.x.below = ee->engine.x.state.below; | ||
598 | |||
599 | prev.prop.modal = ee->prop.modal; | ||
600 | prev.prop.maximized = ee->prop.maximized; | ||
601 | prev.prop.sticky = ee->prop.sticky; | ||
602 | prev.prop.fullscreen = ee->prop.fullscreen; | ||
603 | prev.prop.focus_skip = ee->prop.focus_skip; | ||
604 | |||
605 | ee->engine.x.state.modal = 0; | ||
606 | ee->engine.x.state.sticky = 0; | ||
607 | ee->engine.x.state.maximized_v = 0; | ||
608 | ee->engine.x.state.maximized_h = 0; | ||
609 | ee->engine.x.state.shaded = 0; | ||
556 | ee->engine.x.state.skip_taskbar = 0; | 610 | ee->engine.x.state.skip_taskbar = 0; |
557 | ee->engine.x.state.skip_pager = 0; | 611 | ee->engine.x.state.skip_pager = 0; |
612 | ee->engine.x.state.fullscreen = 0; | ||
613 | ee->engine.x.state.above = 0; | ||
614 | ee->engine.x.state.below = 0; | ||
615 | |||
616 | ee->prop.modal = 0; | ||
617 | ee->prop.maximized = 0; | ||
618 | ee->prop.sticky = 0; | ||
558 | ee->prop.fullscreen = 0; | 619 | ee->prop.fullscreen = 0; |
559 | ee->engine.x.state.fullscreen = 0; | 620 | ee->prop.focus_skip = 0; |
560 | ee->engine.x.state.above = 0; | 621 | |
561 | ee->engine.x.state.below = 0; | ||
562 | |||
563 | ecore_x_netwm_window_state_get(e->win, &state, &num); | 622 | ecore_x_netwm_window_state_get(e->win, &state, &num); |
564 | if (state) | 623 | if (state) |
565 | { | 624 | { |
@@ -568,56 +627,106 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, | |||
568 | switch (state[i]) | 627 | switch (state[i]) |
569 | { | 628 | { |
570 | case ECORE_X_WINDOW_STATE_MODAL: | 629 | case ECORE_X_WINDOW_STATE_MODAL: |
571 | ee->engine.x.state.modal = 1; | 630 | ee->engine.x.state.modal = 1; |
572 | break; | 631 | ee->prop.modal = 1; |
632 | break; | ||
573 | case ECORE_X_WINDOW_STATE_STICKY: | 633 | case ECORE_X_WINDOW_STATE_STICKY: |
574 | if (ee->prop.sticky && ee->engine.x.state.sticky) | 634 | ee->prop.sticky = 1; |
575 | break; | 635 | ee->engine.x.state.sticky = 1; |
576 | 636 | break; | |
577 | sticky = 1; | ||
578 | ee->prop.sticky = 1; | ||
579 | ee->engine.x.state.sticky = 1; | ||
580 | if (ee->func.fn_sticky) ee->func.fn_sticky(ee); | ||
581 | break; | ||
582 | case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT: | 637 | case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT: |
583 | ee->engine.x.state.maximized_v = 1; | 638 | ee->engine.x.state.maximized_v = 1; |
584 | break; | 639 | ee->prop.maximized = 1; |
640 | break; | ||
585 | case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ: | 641 | case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ: |
586 | ee->engine.x.state.maximized_h = 1; | 642 | ee->engine.x.state.maximized_h = 1; |
587 | break; | 643 | ee->prop.maximized = 1; |
644 | break; | ||
588 | case ECORE_X_WINDOW_STATE_SHADED: | 645 | case ECORE_X_WINDOW_STATE_SHADED: |
589 | ee->engine.x.state.shaded = 1; | 646 | ee->engine.x.state.shaded = 1; |
590 | break; | 647 | break; |
591 | case ECORE_X_WINDOW_STATE_SKIP_TASKBAR: | 648 | case ECORE_X_WINDOW_STATE_SKIP_TASKBAR: |
592 | ee->engine.x.state.skip_taskbar = 1; | 649 | ee->engine.x.state.skip_taskbar = 1; |
593 | break; | 650 | ee->prop.focus_skip = 1; |
651 | break; | ||
594 | case ECORE_X_WINDOW_STATE_SKIP_PAGER: | 652 | case ECORE_X_WINDOW_STATE_SKIP_PAGER: |
595 | ee->engine.x.state.skip_pager = 1; | 653 | ee->engine.x.state.skip_pager = 1; |
596 | break; | 654 | ee->prop.focus_skip = 1; |
655 | break; | ||
597 | case ECORE_X_WINDOW_STATE_FULLSCREEN: | 656 | case ECORE_X_WINDOW_STATE_FULLSCREEN: |
598 | ee->prop.fullscreen = 1; | 657 | ee->prop.fullscreen = 1; |
599 | ee->engine.x.state.fullscreen = 1; | 658 | ee->engine.x.state.fullscreen = 1; |
600 | break; | 659 | break; |
601 | case ECORE_X_WINDOW_STATE_ABOVE: | 660 | case ECORE_X_WINDOW_STATE_ABOVE: |
602 | ee->engine.x.state.above = 1; | 661 | ee->engine.x.state.above = 1; |
603 | break; | 662 | break; |
604 | case ECORE_X_WINDOW_STATE_BELOW: | 663 | case ECORE_X_WINDOW_STATE_BELOW: |
605 | ee->engine.x.state.below = 1; | 664 | ee->engine.x.state.below = 1; |
606 | break; | 665 | break; |
607 | default: | 666 | default: |
608 | break; | 667 | break; |
609 | } | 668 | } |
610 | } | 669 | } |
611 | free(state); | 670 | free(state); |
612 | } | 671 | } |
613 | 672 | if ( | |
614 | if ((ee->prop.sticky) && (!sticky)) | 673 | // (prev.x.modal != ee->engine.x.state.modal) || |
674 | (prev.x.sticky != ee->engine.x.state.sticky) || | ||
675 | (prev.x.maximized_v != ee->engine.x.state.maximized_v) || | ||
676 | (prev.x.maximized_h != ee->engine.x.state.maximized_h) || | ||
677 | // (prev.x.shaded != ee->engine.x.state.shaded) || | ||
678 | // (prev.x.skip_taskbar != ee->engine.x.state.skip_taskbar) || | ||
679 | // (prev.x.skip_pager != ee->engine.x.state.skip_pager) || | ||
680 | (prev.x.fullscreen != ee->engine.x.state.fullscreen) || | ||
681 | // (prev.x.above != ee->engine.x.state.above) || | ||
682 | // (prev.x.below != ee->engine.x.state.below) || | ||
683 | // (prev.prop.modal != ee->prop.modal) || | ||
684 | (prev.prop.maximized != ee->prop.maximized) || | ||
685 | (prev.prop.sticky != ee->prop.sticky) || | ||
686 | (prev.prop.fullscreen != ee->prop.fullscreen) || | ||
687 | (prev.prop.focus_skip != ee->prop.focus_skip)) | ||
688 | state_change = 1; | ||
689 | } | ||
690 | else if (e->atom == ECORE_X_ATOM_WM_STATE) | ||
691 | { | ||
692 | Ecore_X_Window_State_Hint state; | ||
693 | |||
694 | // handle WM_STATE changes | ||
695 | state = ecore_x_icccm_state_get(e->win); | ||
696 | switch (state) | ||
615 | { | 697 | { |
616 | ee->prop.sticky = 0; | 698 | case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN: |
617 | ee->engine.x.state.sticky = 0; | 699 | if ((!ee->prop.withdrawn) || (ee->prop.iconified)) |
618 | if (ee->func.fn_unsticky) ee->func.fn_unsticky(ee); | 700 | { |
701 | state_change = 1; | ||
702 | ee->prop.withdrawn = 1; | ||
703 | ee->prop.iconified = 0; | ||
704 | } | ||
705 | break; | ||
706 | case ECORE_X_WINDOW_STATE_HINT_ICONIC: | ||
707 | if ((!ee->prop.iconified) || (ee->prop.withdrawn)) | ||
708 | { | ||
709 | state_change = 1; | ||
710 | ee->prop.iconified = 1; | ||
711 | ee->prop.withdrawn = 0; | ||
712 | } | ||
713 | break; | ||
714 | case ECORE_X_WINDOW_STATE_HINT_NORMAL: | ||
715 | if ((ee->prop.iconified) || (ee->prop.withdrawn)) | ||
716 | { | ||
717 | state_change = 1; | ||
718 | ee->prop.iconified = 0; | ||
719 | ee->prop.withdrawn = 0; | ||
720 | } | ||
721 | break; | ||
722 | default: | ||
723 | break; | ||
619 | } | 724 | } |
620 | } | 725 | } |
726 | if (state_change) | ||
727 | { | ||
728 | if (ee->func.fn_state_change) ee->func.fn_state_change(ee); | ||
729 | } | ||
621 | 730 | ||
622 | return ECORE_CALLBACK_PASS_ON; | 731 | return ECORE_CALLBACK_PASS_ON; |
623 | } | 732 | } |
@@ -826,7 +935,8 @@ _ecore_evas_x_event_window_focus_in(void *data __UNUSED__, int type __UNUSED__, | |||
826 | ee = ecore_event_window_match(e->win); | 935 | ee = ecore_event_window_match(e->win); |
827 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | 936 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ |
828 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 937 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
829 | if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON; | 938 | //xx// filtering with these doesnt help |
939 | //xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON; | ||
830 | ee->prop.focused = 1; | 940 | ee->prop.focused = 1; |
831 | evas_focus_in(ee->evas); | 941 | evas_focus_in(ee->evas); |
832 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); | 942 | if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); |
@@ -843,7 +953,9 @@ _ecore_evas_x_event_window_focus_out(void *data __UNUSED__, int type __UNUSED__, | |||
843 | ee = ecore_event_window_match(e->win); | 953 | ee = ecore_event_window_match(e->win); |
844 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ | 954 | if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ |
845 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; | 955 | if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; |
846 | if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON; | 956 | //xx// filtering with these doesnt help |
957 | //xx// if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON; | ||
958 | |||
847 | // if (ee->prop.fullscreen) | 959 | // if (ee->prop.fullscreen) |
848 | // ecore_x_window_focus(ee->prop.window); | 960 | // ecore_x_window_focus(ee->prop.window); |
849 | evas_focus_out(ee->evas); | 961 | evas_focus_out(ee->evas); |
@@ -1078,8 +1190,8 @@ _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee) | |||
1078 | ee->prop.base.h /* base_h */, | 1190 | ee->prop.base.h /* base_h */, |
1079 | ee->prop.step.w /* step_x */, | 1191 | ee->prop.step.w /* step_x */, |
1080 | ee->prop.step.h /* step_y */, | 1192 | ee->prop.step.h /* step_y */, |
1081 | 0 /* min_aspect */, | 1193 | ee->prop.aspect /* min_aspect */, |
1082 | 0 /* max_aspect */); | 1194 | ee->prop.aspect /* max_aspect */); |
1083 | } | 1195 | } |
1084 | 1196 | ||
1085 | /* FIXME, should be in idler */ | 1197 | /* FIXME, should be in idler */ |
@@ -1089,32 +1201,30 @@ _ecore_evas_x_state_update(Ecore_Evas *ee) | |||
1089 | Ecore_X_Window_State state[10]; | 1201 | Ecore_X_Window_State state[10]; |
1090 | int num = 0; | 1202 | int num = 0; |
1091 | 1203 | ||
1092 | /* | 1204 | if (ee->prop.modal) |
1093 | if (bd->client.netwm.state.modal) | ||
1094 | state[num++] = ECORE_X_WINDOW_STATE_MODAL; | 1205 | state[num++] = ECORE_X_WINDOW_STATE_MODAL; |
1095 | */ | 1206 | if (ee->prop.sticky) |
1096 | if (ee->engine.x.state.sticky) | ||
1097 | state[num++] = ECORE_X_WINDOW_STATE_STICKY; | 1207 | state[num++] = ECORE_X_WINDOW_STATE_STICKY; |
1098 | /* | 1208 | if (ee->prop.maximized) |
1099 | if (bd->client.netwm.state.maximized_v) | ||
1100 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT; | 1209 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT; |
1101 | if (bd->client.netwm.state.maximized_h) | 1210 | if (ee->prop.maximized) |
1102 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ; | 1211 | state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ; |
1103 | if (bd->client.netwm.state.shaded) | 1212 | // if (bd->client.netwm.state.shaded) |
1104 | state[num++] = ECORE_X_WINDOW_STATE_SHADED; | 1213 | // state[num++] = ECORE_X_WINDOW_STATE_SHADED; |
1105 | if (bd->client.netwm.state.skip_taskbar) | 1214 | if (ee->prop.focus_skip) |
1106 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; | 1215 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; |
1107 | if (bd->client.netwm.state.skip_pager) | 1216 | if (ee->prop.focus_skip) |
1108 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER; | 1217 | state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER; |
1109 | if (bd->client.netwm.state.hidden) | 1218 | // if (bd->client.netwm.state.hidden) |
1110 | state[num++] = ECORE_X_WINDOW_STATE_HIDDEN; | 1219 | // state[num++] = ECORE_X_WINDOW_STATE_HIDDEN; |
1111 | */ | ||
1112 | if (ee->engine.x.state.fullscreen) | 1220 | if (ee->engine.x.state.fullscreen) |
1113 | state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN; | 1221 | state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN; |
1114 | if (ee->engine.x.state.above) | 1222 | if (ee->engine.x.state.above) |
1115 | state[num++] = ECORE_X_WINDOW_STATE_ABOVE; | 1223 | state[num++] = ECORE_X_WINDOW_STATE_ABOVE; |
1116 | if (ee->engine.x.state.below) | 1224 | if (ee->engine.x.state.below) |
1117 | state[num++] = ECORE_X_WINDOW_STATE_BELOW; | 1225 | state[num++] = ECORE_X_WINDOW_STATE_BELOW; |
1226 | if (ee->prop.demand_attention) | ||
1227 | state[num++] = ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION; | ||
1118 | 1228 | ||
1119 | ecore_x_netwm_window_state_set(ee->prop.window, state, num); | 1229 | ecore_x_netwm_window_state_set(ee->prop.window, state, num); |
1120 | } | 1230 | } |
@@ -1292,7 +1402,7 @@ _ecore_evas_x_free(Ecore_Evas *ee) | |||
1292 | } | 1402 | } |
1293 | 1403 | ||
1294 | static void | 1404 | static void |
1295 | _ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) | 1405 | _ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) |
1296 | { | 1406 | { |
1297 | ee->func.fn_delete_request = func; | 1407 | ee->func.fn_delete_request = func; |
1298 | _ecore_evas_x_protocols_set(ee); | 1408 | _ecore_evas_x_protocols_set(ee); |
@@ -1578,6 +1688,10 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation, int resize, | |||
1578 | static void | 1688 | static void |
1579 | _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | 1689 | _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) |
1580 | { | 1690 | { |
1691 | int angles[2]; | ||
1692 | angles[0] = rotation; | ||
1693 | angles[1] = ee->rotation; | ||
1694 | |||
1581 | if (ee->rotation == rotation) return; | 1695 | if (ee->rotation == rotation) return; |
1582 | if (!strcmp(ee->driver, "opengl_x11")) | 1696 | if (!strcmp(ee->driver, "opengl_x11")) |
1583 | { | 1697 | { |
@@ -1589,6 +1703,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1589 | einfo->info.rotation = rotation; | 1703 | einfo->info.rotation = rotation; |
1590 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1704 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1591 | (Evas_Engine_Info *)einfo); | 1705 | (Evas_Engine_Info *)einfo); |
1706 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1707 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1708 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1592 | #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ | 1709 | #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */ |
1593 | } | 1710 | } |
1594 | else if (!strcmp(ee->driver, "software_x11")) | 1711 | else if (!strcmp(ee->driver, "software_x11")) |
@@ -1601,6 +1718,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1601 | einfo->info.rotation = rotation; | 1718 | einfo->info.rotation = rotation; |
1602 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1719 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1603 | (Evas_Engine_Info *)einfo); | 1720 | (Evas_Engine_Info *)einfo); |
1721 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1722 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1723 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1604 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ | 1724 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ |
1605 | } | 1725 | } |
1606 | else if (!strcmp(ee->driver, "software_16_x11")) | 1726 | else if (!strcmp(ee->driver, "software_16_x11")) |
@@ -1613,6 +1733,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1613 | einfo->info.rotation = rotation; | 1733 | einfo->info.rotation = rotation; |
1614 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1734 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1615 | (Evas_Engine_Info *)einfo); | 1735 | (Evas_Engine_Info *)einfo); |
1736 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1737 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1738 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1616 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */ | 1739 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */ |
1617 | } | 1740 | } |
1618 | else if (!strcmp(ee->driver, "software_8_x11")) | 1741 | else if (!strcmp(ee->driver, "software_8_x11")) |
@@ -1625,6 +1748,9 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) | |||
1625 | einfo->info.rotation = rotation; | 1748 | einfo->info.rotation = rotation; |
1626 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, | 1749 | _ecore_evas_x_rotation_set_internal(ee, rotation, resize, |
1627 | (Evas_Engine_Info *)einfo); | 1750 | (Evas_Engine_Info *)einfo); |
1751 | ecore_x_window_prop_property_set(ee->prop.window, | ||
1752 | ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, | ||
1753 | ECORE_X_ATOM_CARDINAL, 32, &angles, 2); | ||
1628 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */ | 1754 | #endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */ |
1629 | } | 1755 | } |
1630 | } | 1756 | } |
@@ -1839,14 +1965,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
1839 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 1965 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
1840 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 1966 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
1841 | } | 1967 | } |
1842 | ecore_x_icccm_hints_set(ee->prop.window, | 1968 | _ecore_evas_x_hints_update(ee); |
1843 | 1 /* accepts_focus */, | ||
1844 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
1845 | 0 /* icon_pixmap */, | ||
1846 | 0 /* icon_mask */, | ||
1847 | 0 /* icon_window */, | ||
1848 | 0 /* window_group */, | ||
1849 | 0 /* is_urgent */); | ||
1850 | _ecore_evas_x_group_leader_update(ee); | 1969 | _ecore_evas_x_group_leader_update(ee); |
1851 | ecore_x_window_defaults_set(ee->prop.window); | 1970 | ecore_x_window_defaults_set(ee->prop.window); |
1852 | _ecore_evas_x_protocols_set(ee); | 1971 | _ecore_evas_x_protocols_set(ee); |
@@ -1962,14 +2081,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
1962 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2081 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
1963 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2082 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
1964 | } | 2083 | } |
1965 | ecore_x_icccm_hints_set(ee->prop.window, | 2084 | _ecore_evas_x_hints_update(ee); |
1966 | 1 /* accepts_focus */, | ||
1967 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
1968 | 0 /* icon_pixmap */, | ||
1969 | 0 /* icon_mask */, | ||
1970 | 0 /* icon_window */, | ||
1971 | 0 /* window_group */, | ||
1972 | 0 /* is_urgent */); | ||
1973 | _ecore_evas_x_group_leader_update(ee); | 2085 | _ecore_evas_x_group_leader_update(ee); |
1974 | ecore_x_window_defaults_set(ee->prop.window); | 2086 | ecore_x_window_defaults_set(ee->prop.window); |
1975 | _ecore_evas_x_protocols_set(ee); | 2087 | _ecore_evas_x_protocols_set(ee); |
@@ -2048,14 +2160,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
2048 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2160 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
2049 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2161 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
2050 | } | 2162 | } |
2051 | ecore_x_icccm_hints_set(ee->prop.window, | 2163 | _ecore_evas_x_hints_update(ee); |
2052 | 1 /* accepts_focus */, | ||
2053 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2054 | 0 /* icon_pixmap */, | ||
2055 | 0 /* icon_mask */, | ||
2056 | 0 /* icon_window */, | ||
2057 | 0 /* window_group */, | ||
2058 | 0 /* is_urgent */); | ||
2059 | _ecore_evas_x_group_leader_update(ee); | 2164 | _ecore_evas_x_group_leader_update(ee); |
2060 | ecore_x_window_defaults_set(ee->prop.window); | 2165 | ecore_x_window_defaults_set(ee->prop.window); |
2061 | _ecore_evas_x_protocols_set(ee); | 2166 | _ecore_evas_x_protocols_set(ee); |
@@ -2134,14 +2239,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) | |||
2134 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); | 2239 | ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); |
2135 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); | 2240 | ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); |
2136 | } | 2241 | } |
2137 | ecore_x_icccm_hints_set(ee->prop.window, | 2242 | _ecore_evas_x_hints_update(ee); |
2138 | 1 /* accepts_focus */, | ||
2139 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2140 | 0 /* icon_pixmap */, | ||
2141 | 0 /* icon_mask */, | ||
2142 | 0 /* icon_window */, | ||
2143 | 0 /* window_group */, | ||
2144 | 0 /* is_urgent */); | ||
2145 | _ecore_evas_x_group_leader_update(ee); | 2243 | _ecore_evas_x_group_leader_update(ee); |
2146 | ecore_x_window_defaults_set(ee->prop.window); | 2244 | ecore_x_window_defaults_set(ee->prop.window); |
2147 | _ecore_evas_x_protocols_set(ee); | 2245 | _ecore_evas_x_protocols_set(ee); |
@@ -2182,6 +2280,88 @@ _ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent) | |||
2182 | #endif | 2280 | #endif |
2183 | } | 2281 | } |
2184 | } | 2282 | } |
2283 | |||
2284 | static void | ||
2285 | _ecore_evas_x_window_group_set(Ecore_Evas *ee, const Ecore_Evas *group_ee) | ||
2286 | { | ||
2287 | if (ee->prop.group_ee == group_ee) return; | ||
2288 | |||
2289 | ee->prop.group_ee = (Ecore_Evas *)group_ee; | ||
2290 | if (ee->prop.group_ee) | ||
2291 | ee->prop.group_ee_win = group_ee->prop.window; | ||
2292 | else | ||
2293 | ee->prop.group_ee_win = 0; | ||
2294 | _ecore_evas_x_hints_update(ee); | ||
2295 | } | ||
2296 | |||
2297 | static void | ||
2298 | _ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect) | ||
2299 | { | ||
2300 | if (ee->prop.aspect == aspect) return; | ||
2301 | |||
2302 | ee->prop.aspect = aspect; | ||
2303 | _ecore_evas_x_size_pos_hints_update(ee); | ||
2304 | // netwm state | ||
2305 | // if (ee->should_be_visible) | ||
2306 | // ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2307 | // ECORE_X_WINDOW_STATE_STICKY, -1, sticky); | ||
2308 | // else | ||
2309 | // _ecore_evas_x_state_update(ee); | ||
2310 | } | ||
2311 | |||
2312 | static void | ||
2313 | _ecore_evas_x_urgent_set(Ecore_Evas *ee, int urgent) | ||
2314 | { | ||
2315 | if (ee->prop.urgent == urgent) return; | ||
2316 | |||
2317 | ee->prop.urgent = urgent; | ||
2318 | _ecore_evas_x_hints_update(ee); | ||
2319 | } | ||
2320 | |||
2321 | static void | ||
2322 | _ecore_evas_x_modal_set(Ecore_Evas *ee, int modal) | ||
2323 | { | ||
2324 | if (ee->prop.modal == modal) return; | ||
2325 | |||
2326 | ee->prop.modal = modal; | ||
2327 | if (ee->should_be_visible) | ||
2328 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2329 | ECORE_X_WINDOW_STATE_MODAL, -1, modal); | ||
2330 | else | ||
2331 | _ecore_evas_x_state_update(ee); | ||
2332 | } | ||
2333 | |||
2334 | static void | ||
2335 | _ecore_evas_x_demand_attention_set(Ecore_Evas *ee, int demand) | ||
2336 | { | ||
2337 | if (ee->prop.demand_attention == demand) return; | ||
2338 | |||
2339 | ee->prop.demand_attention = demand; | ||
2340 | if (ee->should_be_visible) | ||
2341 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2342 | ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION, -1, demand); | ||
2343 | else | ||
2344 | _ecore_evas_x_state_update(ee); | ||
2345 | } | ||
2346 | |||
2347 | static void | ||
2348 | _ecore_evas_x_focus_skip_set(Ecore_Evas *ee, int skip) | ||
2349 | { | ||
2350 | if (ee->prop.focus_skip == skip) return; | ||
2351 | |||
2352 | ee->prop.focus_skip = skip; | ||
2353 | if (ee->should_be_visible) | ||
2354 | { | ||
2355 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2356 | ECORE_X_WINDOW_STATE_SKIP_TASKBAR, -1, skip); | ||
2357 | ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root, | ||
2358 | ECORE_X_WINDOW_STATE_SKIP_PAGER, -1, skip); | ||
2359 | } | ||
2360 | else | ||
2361 | _ecore_evas_x_state_update(ee); | ||
2362 | _ecore_evas_x_hints_update(ee); | ||
2363 | } | ||
2364 | |||
2185 | #endif /* BUILD_ECORE_EVAS_X11 */ | 2365 | #endif /* BUILD_ECORE_EVAS_X11 */ |
2186 | 2366 | ||
2187 | #ifdef BUILD_ECORE_EVAS_X11 | 2367 | #ifdef BUILD_ECORE_EVAS_X11 |
@@ -2369,30 +2549,11 @@ _ecore_evas_x_iconified_set(Ecore_Evas *ee, int on) | |||
2369 | { | 2549 | { |
2370 | if (ee->prop.iconified == on) return; | 2550 | if (ee->prop.iconified == on) return; |
2371 | ee->prop.iconified = on; | 2551 | ee->prop.iconified = on; |
2552 | _ecore_evas_x_hints_update(ee); | ||
2372 | if (on) | 2553 | if (on) |
2373 | { | 2554 | ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root); |
2374 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2375 | 1 /* accepts_focus */, | ||
2376 | ECORE_X_WINDOW_STATE_HINT_ICONIC /* initial_state */, | ||
2377 | 0 /* icon_pixmap */, | ||
2378 | 0 /* icon_mask */, | ||
2379 | 0 /* icon_window */, | ||
2380 | 0 /* window_group */, | ||
2381 | 0 /* is_urgent */); | ||
2382 | ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root); | ||
2383 | } | ||
2384 | else | 2555 | else |
2385 | { | 2556 | ecore_evas_show(ee); |
2386 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2387 | 1 /* accepts_focus */, | ||
2388 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
2389 | 0 /* icon_pixmap */, | ||
2390 | 0 /* icon_mask */, | ||
2391 | 0 /* icon_window */, | ||
2392 | 0 /* window_group */, | ||
2393 | 0 /* is_urgent */); | ||
2394 | ecore_evas_show(ee); | ||
2395 | } | ||
2396 | } | 2557 | } |
2397 | 2558 | ||
2398 | static void | 2559 | static void |
@@ -2408,24 +2569,9 @@ _ecore_evas_x_borderless_set(Ecore_Evas *ee, int on) | |||
2408 | static void | 2569 | static void |
2409 | _ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn) | 2570 | _ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn) |
2410 | { | 2571 | { |
2411 | Ecore_X_Window_State_Hint hint; | ||
2412 | |||
2413 | if (ee->prop.withdrawn == withdrawn) return; | 2572 | if (ee->prop.withdrawn == withdrawn) return; |
2414 | |||
2415 | ee->prop.withdrawn = withdrawn; | 2573 | ee->prop.withdrawn = withdrawn; |
2416 | if (withdrawn) | 2574 | _ecore_evas_x_hints_update(ee); |
2417 | hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN; | ||
2418 | else | ||
2419 | hint = ECORE_X_WINDOW_STATE_HINT_NORMAL; | ||
2420 | |||
2421 | ecore_x_icccm_hints_set(ee->prop.window, | ||
2422 | 1 /* accepts_focus */, | ||
2423 | hint /* initial_state */, | ||
2424 | 0 /* icon_pixmap */, | ||
2425 | 0 /* icon_mask */, | ||
2426 | 0 /* icon_window */, | ||
2427 | 0 /* window_group */, | ||
2428 | 0 /* is_urgent */); | ||
2429 | } | 2575 | } |
2430 | 2576 | ||
2431 | static void | 2577 | static void |
@@ -2762,6 +2908,13 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func = | |||
2762 | _ecore_evas_x_ignore_events_set, | 2908 | _ecore_evas_x_ignore_events_set, |
2763 | _ecore_evas_x_alpha_set, | 2909 | _ecore_evas_x_alpha_set, |
2764 | _ecore_evas_x_transparent_set, | 2910 | _ecore_evas_x_transparent_set, |
2911 | |||
2912 | _ecore_evas_x_window_group_set, | ||
2913 | _ecore_evas_x_aspect_set, | ||
2914 | _ecore_evas_x_urgent_set, | ||
2915 | _ecore_evas_x_modal_set, | ||
2916 | _ecore_evas_x_demand_attention_set, | ||
2917 | _ecore_evas_x_focus_skip_set, | ||
2765 | 2918 | ||
2766 | NULL, // render | 2919 | NULL, // render |
2767 | _ecore_evas_x_screen_geometry_get | 2920 | _ecore_evas_x_screen_geometry_get |
@@ -3003,14 +3156,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, | |||
3003 | } | 3156 | } |
3004 | } | 3157 | } |
3005 | 3158 | ||
3006 | ecore_x_icccm_hints_set(ee->prop.window, | 3159 | _ecore_evas_x_hints_update(ee); |
3007 | 1 /* accepts_focus */, | ||
3008 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3009 | 0 /* icon_pixmap */, | ||
3010 | 0 /* icon_mask */, | ||
3011 | 0 /* icon_window */, | ||
3012 | 0 /* window_group */, | ||
3013 | 0 /* is_urgent */); | ||
3014 | _ecore_evas_x_group_leader_set(ee); | 3160 | _ecore_evas_x_group_leader_set(ee); |
3015 | ecore_x_window_defaults_set(ee->prop.window); | 3161 | ecore_x_window_defaults_set(ee->prop.window); |
3016 | _ecore_evas_x_protocols_set(ee); | 3162 | _ecore_evas_x_protocols_set(ee); |
@@ -3240,14 +3386,7 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, | |||
3240 | // putenv((char*)"DESKTOP_STARTUP_ID="); | 3386 | // putenv((char*)"DESKTOP_STARTUP_ID="); |
3241 | } | 3387 | } |
3242 | 3388 | ||
3243 | ecore_x_icccm_hints_set(ee->prop.window, | 3389 | _ecore_evas_x_hints_update(ee); |
3244 | 1 /* accepts_focus */, | ||
3245 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3246 | 0 /* icon_pixmap */, | ||
3247 | 0 /* icon_mask */, | ||
3248 | 0 /* icon_window */, | ||
3249 | 0 /* window_group */, | ||
3250 | 0 /* is_urgent */); | ||
3251 | _ecore_evas_x_group_leader_set(ee); | 3390 | _ecore_evas_x_group_leader_set(ee); |
3252 | ecore_x_window_defaults_set(ee->prop.window); | 3391 | ecore_x_window_defaults_set(ee->prop.window); |
3253 | _ecore_evas_x_protocols_set(ee); | 3392 | _ecore_evas_x_protocols_set(ee); |
@@ -3571,14 +3710,7 @@ ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent, | |||
3571 | return NULL; | 3710 | return NULL; |
3572 | } | 3711 | } |
3573 | 3712 | ||
3574 | ecore_x_icccm_hints_set(ee->prop.window, | 3713 | _ecore_evas_x_hints_update(ee); |
3575 | 1 /* accepts_focus */, | ||
3576 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3577 | 0 /* icon_pixmap */, | ||
3578 | 0 /* icon_mask */, | ||
3579 | 0 /* icon_window */, | ||
3580 | 0 /* window_group */, | ||
3581 | 0 /* is_urgent */); | ||
3582 | _ecore_evas_x_group_leader_set(ee); | 3714 | _ecore_evas_x_group_leader_set(ee); |
3583 | ecore_x_window_defaults_set(ee->prop.window); | 3715 | ecore_x_window_defaults_set(ee->prop.window); |
3584 | _ecore_evas_x_protocols_set(ee); | 3716 | _ecore_evas_x_protocols_set(ee); |
@@ -3895,14 +4027,7 @@ ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent, | |||
3895 | return NULL; | 4027 | return NULL; |
3896 | } | 4028 | } |
3897 | 4029 | ||
3898 | ecore_x_icccm_hints_set(ee->prop.window, | 4030 | _ecore_evas_x_hints_update(ee); |
3899 | 1 /* accepts_focus */, | ||
3900 | ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */, | ||
3901 | 0 /* icon_pixmap */, | ||
3902 | 0 /* icon_mask */, | ||
3903 | 0 /* icon_window */, | ||
3904 | 0 /* window_group */, | ||
3905 | 0 /* is_urgent */); | ||
3906 | _ecore_evas_x_group_leader_set(ee); | 4031 | _ecore_evas_x_group_leader_set(ee); |
3907 | ecore_x_window_defaults_set(ee->prop.window); | 4032 | ecore_x_window_defaults_set(ee->prop.window); |
3908 | _ecore_evas_x_protocols_set(ee); | 4033 | _ecore_evas_x_protocols_set(ee); |