summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2020-10-13 15:19:39 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-10-13 15:19:39 +0100
commit25e64a9a4e3adc259e81093a223c12996e424bf1 (patch)
treef7b361e295588ad8e89f11b9480989aada1ef940 /src/modules
parentb9df223fa2fb0c0293b3b28363030965e5acb9ff (diff)
Ecore_Win32: add the API ecore_win32_window_maximized_set()
Summary: ecore_evas win32 engine is updated to support it. This fixes the "maximized/unmaximized" elm "windows states" test. Test Plan: elm_test Reviewers: raster, jptiz, felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12177
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index b159779940..623515da95 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -73,6 +73,7 @@ struct _Ecore_Evas_Engine_Data_Win32
73 { 73 {
74 unsigned char region : 1; 74 unsigned char region : 1;
75 unsigned char fullscreen : 1; 75 unsigned char fullscreen : 1;
76 unsigned char maximized : 1;
76 } state; 77 } state;
77}; 78};
78 79
@@ -434,9 +435,11 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
434{ 435{
435 struct { 436 struct {
436 struct { 437 struct {
438 unsigned char maximized : 1;
437 unsigned char fullscreen : 1; 439 unsigned char fullscreen : 1;
438 } win32; 440 } win32;
439 struct { 441 struct {
442 Eina_Bool maximized : 1;
440 Eina_Bool fullscreen : 1; 443 Eina_Bool fullscreen : 1;
441 } prop; 444 } prop;
442 } prev; 445 } prev;
@@ -456,12 +459,16 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
456 wdata = ee->engine.data; 459 wdata = ee->engine.data;
457 460
458 prev.win32.fullscreen = wdata->state.fullscreen; 461 prev.win32.fullscreen = wdata->state.fullscreen;
462 prev.win32.maximized = wdata->state.maximized;
459 463
460 prev.prop.fullscreen = ee->prop.fullscreen; 464 prev.prop.fullscreen = ee->prop.fullscreen;
465 prev.prop.maximized = ee->prop.maximized;
461 466
462 wdata->state.fullscreen = 0; 467 wdata->state.fullscreen = 0;
468 wdata->state.maximized = 0;
463 469
464 ee->prop.fullscreen = EINA_FALSE; 470 ee->prop.fullscreen = EINA_FALSE;
471 ee->prop.maximized = EINA_FALSE;
465 472
466 /* we get the states status */ 473 /* we get the states status */
467 ecore_win32_window_state_get(e->window, &state, &num); 474 ecore_win32_window_state_get(e->window, &state, &num);
@@ -475,6 +482,10 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
475 ee->prop.fullscreen = 1; 482 ee->prop.fullscreen = 1;
476 wdata->state.fullscreen = 1; 483 wdata->state.fullscreen = 1;
477 break; 484 break;
485 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
486 ee->prop.maximized = 1;
487 wdata->state.maximized = 1;
488 break;
478 default: 489 default:
479 break; 490 break;
480 } 491 }
@@ -483,7 +494,9 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
483 } 494 }
484 495
485 if ((prev.win32.fullscreen != wdata->state.fullscreen) || 496 if ((prev.win32.fullscreen != wdata->state.fullscreen) ||
486 (prev.prop.fullscreen != ee->prop.fullscreen)) 497 (prev.prop.fullscreen != ee->prop.fullscreen) ||
498 (prev.win32.maximized != wdata->state.maximized) ||
499 (prev.prop.maximized != ee->prop.maximized))
487 { 500 {
488 if (ee->func.fn_state_change) 501 if (ee->func.fn_state_change)
489 ee->func.fn_state_change(ee); 502 ee->func.fn_state_change(ee);
@@ -508,6 +521,8 @@ _ecore_evas_win32_state_update(Ecore_Evas *ee)
508 state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT; 521 state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT;
509 if (ee->prop.maximized) 522 if (ee->prop.maximized)
510 state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ; 523 state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ;
524 if (ee->prop.maximized)
525 state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED;
511// if (bd->client.netwm.state.shaded) 526// if (bd->client.netwm.state.shaded)
512// state[num++] = ECORE_WIN32_WINDOW_STATE_SHADED; 527// state[num++] = ECORE_WIN32_WINDOW_STATE_SHADED;
513 /* if (ee->prop.focus_skip) */ 528 /* if (ee->prop.focus_skip) */
@@ -832,7 +847,7 @@ _ecore_evas_win32_activate(Ecore_Evas *ee)
832 INF("ecore evas activate"); 847 INF("ecore evas activate");
833 848
834 ecore_evas_show(ee); 849 ecore_evas_show(ee);
835 ecore_win32_window_activate(ee->prop.window); 850 ecore_win32_window_activate((Ecore_Win32_Window *)ee->prop.window);
836} 851}
837 852
838static void 853static void
@@ -975,6 +990,30 @@ _ecore_evas_win32_override_set(Ecore_Evas *ee, Eina_Bool on)
975} 990}
976 991
977static void 992static void
993_ecore_evas_win32_maximized_set(Ecore_Evas *ee, Eina_Bool on)
994{
995 Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data;
996
997 INF("ecore evas maximized set");
998
999 wdata->state.maximized = !!on;
1000 if (ee->should_be_visible)
1001 {
1002 struct _Ecore_Win32_Window *window;
1003
1004 window = (Ecore_Win32_Window *)ee->prop.window;
1005 ecore_win32_window_maximized_set(window, on);
1006 }
1007 else
1008 {
1009 if (ee->prop.maximized == on) return;
1010 ee->prop.maximized = on;
1011 wdata->state.maximized = on;
1012 _ecore_evas_win32_state_update(ee);
1013 }
1014}
1015
1016static void
978_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, Eina_Bool on) 1017_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
979{ 1018{
980 Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data; 1019 Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data;
@@ -1373,7 +1412,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1373 _ecore_evas_win32_iconified_set, 1412 _ecore_evas_win32_iconified_set,
1374 _ecore_evas_win32_borderless_set, 1413 _ecore_evas_win32_borderless_set,
1375 _ecore_evas_win32_override_set, 1414 _ecore_evas_win32_override_set,
1376 NULL, /* _ecore_evas_x_maximize_set */ 1415 _ecore_evas_win32_maximized_set,
1377 _ecore_evas_win32_fullscreen_set, 1416 _ecore_evas_win32_fullscreen_set,
1378 NULL, /* _ecore_evas_x_avoid_damage_set */ 1417 NULL, /* _ecore_evas_x_avoid_damage_set */
1379 NULL, /* _ecore_evas_x_withdrawn_set */ 1418 NULL, /* _ecore_evas_x_withdrawn_set */