| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/wayland/server.h" | 5 #include "components/exo/wayland/server.h" |
| 6 | 6 |
| 7 #include <grp.h> | 7 #include <grp.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 case ash::wm::WINDOW_STATE_TYPE_FULLSCREEN: | 1679 case ash::wm::WINDOW_STATE_TYPE_FULLSCREEN: |
| 1680 zwp_remote_surface_v1_send_unset_fullscreen(resource); | 1680 zwp_remote_surface_v1_send_unset_fullscreen(resource); |
| 1681 break; | 1681 break; |
| 1682 case ash::wm::WINDOW_STATE_TYPE_PINNED: | 1682 case ash::wm::WINDOW_STATE_TYPE_PINNED: |
| 1683 if (wl_resource_get_version(resource) >= 3) | 1683 if (wl_resource_get_version(resource) >= 3) |
| 1684 zwp_remote_surface_v1_send_unset_pinned(resource); | 1684 zwp_remote_surface_v1_send_unset_pinned(resource); |
| 1685 break; | 1685 break; |
| 1686 default: | 1686 default: |
| 1687 break; | 1687 break; |
| 1688 } | 1688 } |
| 1689 |
| 1690 uint32_t state_type = ZWP_REMOTE_SHELL_V1_STATE_TYPE_NORMAL; |
| 1689 switch (new_state_type) { | 1691 switch (new_state_type) { |
| 1690 case ash::wm::WINDOW_STATE_TYPE_MINIMIZED: | 1692 case ash::wm::WINDOW_STATE_TYPE_MINIMIZED: |
| 1693 state_type = ZWP_REMOTE_SHELL_V1_STATE_TYPE_MINIMIZED; |
| 1691 if (wl_resource_get_version(resource) >= 2) | 1694 if (wl_resource_get_version(resource) >= 2) |
| 1692 zwp_remote_surface_v1_send_set_minimized(resource); | 1695 zwp_remote_surface_v1_send_set_minimized(resource); |
| 1693 break; | 1696 break; |
| 1694 case ash::wm::WINDOW_STATE_TYPE_MAXIMIZED: | 1697 case ash::wm::WINDOW_STATE_TYPE_MAXIMIZED: |
| 1698 state_type = ZWP_REMOTE_SHELL_V1_STATE_TYPE_MAXIMIZED; |
| 1695 if (wl_resource_get_version(resource) >= 2) | 1699 if (wl_resource_get_version(resource) >= 2) |
| 1696 zwp_remote_surface_v1_send_set_maximized(resource); | 1700 zwp_remote_surface_v1_send_set_maximized(resource); |
| 1697 break; | 1701 break; |
| 1698 case ash::wm::WINDOW_STATE_TYPE_FULLSCREEN: | 1702 case ash::wm::WINDOW_STATE_TYPE_FULLSCREEN: |
| 1703 state_type = ZWP_REMOTE_SHELL_V1_STATE_TYPE_FULLSCREEN; |
| 1699 zwp_remote_surface_v1_send_set_fullscreen(resource); | 1704 zwp_remote_surface_v1_send_set_fullscreen(resource); |
| 1700 break; | 1705 break; |
| 1701 case ash::wm::WINDOW_STATE_TYPE_PINNED: | 1706 case ash::wm::WINDOW_STATE_TYPE_PINNED: |
| 1707 state_type = ZWP_REMOTE_SHELL_V1_STATE_TYPE_PINNED; |
| 1702 if (wl_resource_get_version(resource) >= 3) | 1708 if (wl_resource_get_version(resource) >= 3) |
| 1703 zwp_remote_surface_v1_send_set_pinned(resource); | 1709 zwp_remote_surface_v1_send_set_pinned(resource); |
| 1704 break; | 1710 break; |
| 1705 default: | 1711 default: |
| 1706 break; | 1712 break; |
| 1707 } | 1713 } |
| 1714 |
| 1715 if (wl_resource_get_version(resource) >= 7) |
| 1716 zwp_remote_surface_v1_send_state_type_changed(resource, state_type); |
| 1717 |
| 1708 wl_client_flush(wl_resource_get_client(resource)); | 1718 wl_client_flush(wl_resource_get_client(resource)); |
| 1709 } | 1719 } |
| 1710 | 1720 |
| 1711 void remote_shell_get_remote_surface(wl_client* client, | 1721 void remote_shell_get_remote_surface(wl_client* client, |
| 1712 wl_resource* resource, | 1722 wl_resource* resource, |
| 1713 uint32_t id, | 1723 uint32_t id, |
| 1714 wl_resource* surface, | 1724 wl_resource* surface, |
| 1715 uint32_t container) { | 1725 uint32_t container) { |
| 1716 std::unique_ptr<ShellSurface> shell_surface = | 1726 std::unique_ptr<ShellSurface> shell_surface = |
| 1717 GetUserDataAs<WaylandRemoteShell>(resource)->CreateShellSurface( | 1727 GetUserDataAs<WaylandRemoteShell>(resource)->CreateShellSurface( |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2836 DCHECK(event_loop); | 2846 DCHECK(event_loop); |
| 2837 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 2847 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 2838 } | 2848 } |
| 2839 | 2849 |
| 2840 void Server::Flush() { | 2850 void Server::Flush() { |
| 2841 wl_display_flush_clients(wl_display_.get()); | 2851 wl_display_flush_clients(wl_display_.get()); |
| 2842 } | 2852 } |
| 2843 | 2853 |
| 2844 } // namespace wayland | 2854 } // namespace wayland |
| 2845 } // namespace exo | 2855 } // namespace exo |
| OLD | NEW |