summaryrefslogtreecommitdiff
path: root/src/lib
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/lib
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/lib')
-rw-r--r--src/lib/ecore_win32/Ecore_Win32.h2
-rw-r--r--src/lib/ecore_win32/ecore_win32_private.h1
-rw-r--r--src/lib/ecore_win32/ecore_win32_window.c35
3 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/ecore_win32/Ecore_Win32.h b/src/lib/ecore_win32/Ecore_Win32.h
index fa5b80eb48..bb26a352d6 100644
--- a/src/lib/ecore_win32/Ecore_Win32.h
+++ b/src/lib/ecore_win32/Ecore_Win32.h
@@ -625,6 +625,8 @@ EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
625 625
626EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window, 626EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
627 Eina_Bool on); 627 Eina_Bool on);
628EAPI void ecore_win32_window_maximized_set(Ecore_Win32_Window *window,
629 Eina_Bool on);
628 630
629EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, 631EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
630 Eina_Bool on); 632 Eina_Bool on);
diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h
index 88d0e12afb..64304bb606 100644
--- a/src/lib/ecore_win32/ecore_win32_private.h
+++ b/src/lib/ecore_win32/ecore_win32_private.h
@@ -104,6 +104,7 @@ struct _Ecore_Win32_Window
104 unsigned int pointer_is_in : 1; 104 unsigned int pointer_is_in : 1;
105 unsigned int borderless : 1; 105 unsigned int borderless : 1;
106 unsigned int iconified : 1; 106 unsigned int iconified : 1;
107 unsigned int maximized : 1;
107 unsigned int fullscreen : 1; 108 unsigned int fullscreen : 1;
108 109
109 struct { 110 struct {
diff --git a/src/lib/ecore_win32/ecore_win32_window.c b/src/lib/ecore_win32/ecore_win32_window.c
index 2199d4a6df..914e0cf9ce 100644
--- a/src/lib/ecore_win32/ecore_win32_window.c
+++ b/src/lib/ecore_win32/ecore_win32_window.c
@@ -146,6 +146,7 @@ _ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
146 w->pointer_is_in = 0; 146 w->pointer_is_in = 0;
147 w->borderless = 0; 147 w->borderless = 0;
148 w->iconified = 0; 148 w->iconified = 0;
149 w->maximized = 0;
149 w->fullscreen = 0; 150 w->fullscreen = 0;
150 151
151 w->drag.x = x; 152 w->drag.x = x;
@@ -1360,6 +1361,37 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
1360} 1361}
1361 1362
1362/** 1363/**
1364 * @brief Maximize or restore the given window.
1365 *
1366 * @param window The window.
1367 * @param on @c EINA_TRUE for maximized window, @c EINA_FALSE to
1368 * restore it.
1369 *
1370 * This function maximizes @p window if @p on is set
1371 * to @c EINA_TRUE, or restores the window if it is set to
1372 * @c EINA_FALSE. If @p window is @c NULL or if the state
1373 * does not change (like setting to fullscreenmaximized the window is already
1374 * maximized), this function does nothing.
1375 *
1376 * @since 1.26
1377 */
1378EAPI void
1379ecore_win32_window_maximized_set(Ecore_Win32_Window *window,
1380 Eina_Bool on)
1381{
1382 if (!window) return;
1383
1384 if (((window->maximized) && (on)) ||
1385 ((!window->maximized) && (!on)))
1386 return;
1387
1388 INF("maximizing window: %s", on ? "yes" : "no");
1389
1390 ShowWindow(window->window, on ? SW_MAXIMIZE : SW_RESTORE);
1391 window->maximized = on;
1392}
1393
1394/**
1363 * @brief Set the given window to fullscreen. 1395 * @brief Set the given window to fullscreen.
1364 * 1396 *
1365 * @param window The window. 1397 * @param window The window.
@@ -1525,8 +1557,7 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window,
1525 window->state.maximized_horz = 1; 1557 window->state.maximized_horz = 1;
1526 break; 1558 break;
1527 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED: 1559 case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
1528 window->state.maximized_horz = 1; 1560 window->state.maximized = 1;
1529 window->state.maximized_vert = 1;
1530 break; 1561 break;
1531 case ECORE_WIN32_WINDOW_STATE_SHADED: 1562 case ECORE_WIN32_WINDOW_STATE_SHADED:
1532 window->state.shaded = 1; 1563 window->state.shaded = 1;