2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/InlineLinkedList.h>
|
2019-12-02 11:33:37 +03:00
|
|
|
#include <AK/String.h>
|
2020-05-01 23:59:38 +03:00
|
|
|
#include <AK/WeakPtr.h>
|
2020-02-06 17:04:03 +03:00
|
|
|
#include <LibCore/Object.h>
|
2020-02-06 14:07:05 +03:00
|
|
|
#include <LibGfx/Bitmap.h>
|
2020-02-06 22:03:37 +03:00
|
|
|
#include <LibGfx/DisjointRectSet.h>
|
2020-02-06 14:04:00 +03:00
|
|
|
#include <LibGfx/Rect.h>
|
2021-01-22 00:31:00 +03:00
|
|
|
#include <WindowServer/Cursor.h>
|
2020-02-06 22:03:37 +03:00
|
|
|
#include <WindowServer/WindowFrame.h>
|
|
|
|
#include <WindowServer/WindowType.h>
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
namespace WindowServer {
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
class ClientConnection;
|
|
|
|
class Cursor;
|
|
|
|
class Menu;
|
2020-04-30 13:58:38 +03:00
|
|
|
class MenuItem;
|
2020-02-06 22:03:37 +03:00
|
|
|
class MouseEvent;
|
|
|
|
|
|
|
|
enum WMEventMask {
|
2019-12-02 11:33:37 +03:00
|
|
|
WindowRectChanges = 1 << 0,
|
|
|
|
WindowStateChanges = 1 << 1,
|
|
|
|
WindowIconChanges = 1 << 2,
|
|
|
|
WindowRemovals = 1 << 3,
|
|
|
|
};
|
|
|
|
|
2020-01-01 20:24:14 +03:00
|
|
|
enum class WindowTileType {
|
|
|
|
None = 0,
|
|
|
|
Left,
|
|
|
|
Right,
|
2020-12-05 04:26:21 +03:00
|
|
|
Top,
|
|
|
|
Bottom,
|
|
|
|
TopLeft,
|
|
|
|
TopRight,
|
|
|
|
BottomLeft,
|
|
|
|
BottomRight
|
2020-01-01 20:24:14 +03:00
|
|
|
};
|
|
|
|
|
2020-01-04 16:14:36 +03:00
|
|
|
enum class PopupMenuItem {
|
|
|
|
Minimize = 0,
|
|
|
|
Maximize,
|
|
|
|
};
|
|
|
|
|
2020-07-07 21:09:18 +03:00
|
|
|
enum class WindowMenuDefaultAction {
|
|
|
|
None = 0,
|
|
|
|
BasedOnWindowState,
|
|
|
|
Close,
|
|
|
|
Minimize,
|
|
|
|
Unminimize,
|
|
|
|
Maximize,
|
|
|
|
Restore
|
|
|
|
};
|
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
class Window final : public Core::Object
|
|
|
|
, public InlineLinkedListNode<Window> {
|
|
|
|
C_OBJECT(Window)
|
2019-01-16 18:03:50 +03:00
|
|
|
public:
|
2020-07-15 04:17:00 +03:00
|
|
|
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
|
2020-02-06 22:03:37 +03:00
|
|
|
Window(Core::Object&, WindowType);
|
|
|
|
virtual ~Window() override;
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-07-07 21:09:18 +03:00
|
|
|
void popup_window_menu(const Gfx::IntPoint&, WindowMenuDefaultAction);
|
|
|
|
void window_menu_activate_default();
|
2019-06-21 12:03:43 +03:00
|
|
|
void request_close();
|
|
|
|
|
2019-04-20 15:40:38 +03:00
|
|
|
unsigned wm_event_mask() const { return m_wm_event_mask; }
|
|
|
|
void set_wm_event_mask(unsigned mask) { m_wm_event_mask = mask; }
|
|
|
|
|
2019-04-05 23:32:00 +03:00
|
|
|
bool is_minimized() const { return m_minimized; }
|
|
|
|
void set_minimized(bool);
|
|
|
|
|
2020-01-04 14:12:02 +03:00
|
|
|
bool is_minimizable() const { return m_minimizable; }
|
|
|
|
void set_minimizable(bool);
|
|
|
|
|
|
|
|
bool is_resizable() const { return m_resizable && !m_fullscreen; }
|
|
|
|
void set_resizable(bool);
|
|
|
|
|
2019-05-12 22:32:02 +03:00
|
|
|
bool is_maximized() const { return m_maximized; }
|
2021-01-23 03:40:19 +03:00
|
|
|
void set_maximized(bool, Optional<Gfx::IntPoint> fixed_point = {});
|
2019-05-12 22:32:02 +03:00
|
|
|
|
2021-01-26 23:50:02 +03:00
|
|
|
void set_vertically_maximized();
|
|
|
|
|
2019-05-17 22:33:44 +03:00
|
|
|
bool is_fullscreen() const { return m_fullscreen; }
|
2019-09-16 19:38:42 +03:00
|
|
|
void set_fullscreen(bool);
|
2019-05-17 22:33:44 +03:00
|
|
|
|
2020-01-01 20:24:14 +03:00
|
|
|
WindowTileType tiled() const { return m_tiled; }
|
|
|
|
void set_tiled(WindowTileType);
|
2021-01-30 21:57:27 +03:00
|
|
|
bool set_untiled(Optional<Gfx::IntPoint> fixed_point = {});
|
2020-01-01 20:24:14 +03:00
|
|
|
|
2019-12-27 13:34:40 +03:00
|
|
|
bool is_occluded() const { return m_occluded; }
|
|
|
|
void set_occluded(bool);
|
|
|
|
|
2019-07-31 18:49:40 +03:00
|
|
|
bool is_movable() const
|
|
|
|
{
|
2020-02-06 22:03:37 +03:00
|
|
|
return m_type == WindowType::Normal;
|
2019-07-31 18:49:40 +03:00
|
|
|
}
|
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
WindowFrame& frame() { return m_frame; }
|
|
|
|
const WindowFrame& frame() const { return m_frame; }
|
2019-04-05 16:54:56 +03:00
|
|
|
|
2021-01-07 22:12:17 +03:00
|
|
|
Window* blocking_modal_window();
|
2019-03-19 02:52:39 +03:00
|
|
|
|
2019-04-04 02:44:35 +03:00
|
|
|
bool listens_to_wm_events() const { return m_listens_to_wm_events; }
|
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
ClientConnection* client() { return m_client; }
|
|
|
|
const ClientConnection* client() const { return m_client; }
|
2019-02-13 02:19:21 +03:00
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
WindowType type() const { return m_type; }
|
2019-01-16 18:03:50 +03:00
|
|
|
int window_id() const { return m_window_id; }
|
|
|
|
|
2020-01-25 12:25:49 +03:00
|
|
|
bool is_internal() const { return m_client_id == -1; }
|
|
|
|
i32 client_id() const { return m_client_id; }
|
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
String title() const { return m_title; }
|
2019-05-12 15:57:15 +03:00
|
|
|
void set_title(const String&);
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2019-02-19 03:42:53 +03:00
|
|
|
float opacity() const { return m_opacity; }
|
2019-12-27 13:34:40 +03:00
|
|
|
void set_opacity(float);
|
2019-02-19 03:42:53 +03:00
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
int x() const { return m_rect.x(); }
|
|
|
|
int y() const { return m_rect.y(); }
|
|
|
|
int width() const { return m_rect.width(); }
|
|
|
|
int height() const { return m_rect.height(); }
|
|
|
|
|
2019-03-03 17:17:05 +03:00
|
|
|
bool is_active() const;
|
|
|
|
|
2019-02-11 11:47:10 +03:00
|
|
|
bool is_visible() const { return m_visible; }
|
|
|
|
void set_visible(bool);
|
|
|
|
|
2020-07-16 02:40:52 +03:00
|
|
|
bool is_modal() const;
|
|
|
|
bool is_modal_dont_unparent() const { return m_modal && m_parent_window; }
|
2019-03-19 02:52:39 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntRect rect() const { return m_rect; }
|
|
|
|
void set_rect(const Gfx::IntRect&);
|
2019-02-11 11:47:10 +03:00
|
|
|
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
|
2020-06-10 11:57:59 +03:00
|
|
|
void set_rect_without_repaint(const Gfx::IntRect&);
|
2021-01-29 00:47:32 +03:00
|
|
|
void apply_minimum_size(Gfx::IntRect&);
|
|
|
|
void nudge_into_desktop(bool force_titlebar_visible = true);
|
2019-04-05 16:54:56 +03:00
|
|
|
|
2020-08-18 22:33:43 +03:00
|
|
|
void set_taskbar_rect(const Gfx::IntRect&);
|
2020-06-10 11:57:59 +03:00
|
|
|
const Gfx::IntRect& taskbar_rect() const { return m_taskbar_rect; }
|
2019-12-03 23:34:34 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
void move_to(const Gfx::IntPoint& position) { set_rect({ position, size() }); }
|
2019-02-11 11:47:10 +03:00
|
|
|
void move_to(int x, int y) { move_to({ x, y }); }
|
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
void move_by(const Gfx::IntPoint& delta) { set_position_without_repaint(position().translated(delta)); }
|
2020-05-02 00:00:42 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntPoint position() const { return m_rect.location(); }
|
|
|
|
void set_position(const Gfx::IntPoint& position) { set_rect({ position.x(), position.y(), width(), height() }); }
|
|
|
|
void set_position_without_repaint(const Gfx::IntPoint& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); }
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntSize size() const { return m_rect.size(); }
|
2019-02-11 11:47:10 +03:00
|
|
|
|
2021-02-10 21:54:58 +03:00
|
|
|
void invalidate(bool with_frame = true, bool re_render_frame = false);
|
2020-09-07 20:34:30 +03:00
|
|
|
void invalidate(const Gfx::IntRect&, bool with_frame = false);
|
|
|
|
bool invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame = false);
|
2020-08-18 07:45:10 +03:00
|
|
|
|
|
|
|
void prepare_dirty_rects();
|
|
|
|
void clear_dirty_rects();
|
|
|
|
Gfx::DisjointRectSet& dirty_rects() { return m_dirty_rects; }
|
2019-02-11 11:47:10 +03:00
|
|
|
|
2020-02-02 14:34:39 +03:00
|
|
|
virtual void event(Core::Event&) override;
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
// Only used by WindowType::MenuApplet. Perhaps it could be a Window subclass? I don't know.
|
2020-06-10 11:57:59 +03:00
|
|
|
void set_rect_in_menubar(const Gfx::IntRect& rect) { m_rect_in_menubar = rect; }
|
|
|
|
const Gfx::IntRect& rect_in_menubar() const { return m_rect_in_menubar; }
|
2019-12-16 17:05:45 +03:00
|
|
|
|
2020-02-06 13:56:38 +03:00
|
|
|
const Gfx::Bitmap* backing_store() const { return m_backing_store.ptr(); }
|
|
|
|
Gfx::Bitmap* backing_store() { return m_backing_store.ptr(); }
|
2019-12-16 17:05:45 +03:00
|
|
|
|
2021-01-15 14:11:22 +03:00
|
|
|
void set_backing_store(RefPtr<Gfx::Bitmap> backing_store, i32 serial)
|
2019-03-18 22:52:23 +03:00
|
|
|
{
|
|
|
|
m_last_backing_store = move(m_backing_store);
|
|
|
|
m_backing_store = move(backing_store);
|
2021-01-15 14:11:22 +03:00
|
|
|
|
|
|
|
m_last_backing_store_serial = m_backing_store_serial;
|
|
|
|
m_backing_store_serial = serial;
|
2019-03-18 22:52:23 +03:00
|
|
|
}
|
2019-12-16 17:05:45 +03:00
|
|
|
|
2019-03-18 22:52:23 +03:00
|
|
|
void swap_backing_stores()
|
|
|
|
{
|
|
|
|
swap(m_backing_store, m_last_backing_store);
|
2021-01-15 14:11:22 +03:00
|
|
|
swap(m_backing_store_serial, m_last_backing_store_serial);
|
2019-03-18 22:52:23 +03:00
|
|
|
}
|
|
|
|
|
2020-02-06 13:56:38 +03:00
|
|
|
Gfx::Bitmap* last_backing_store() { return m_last_backing_store.ptr(); }
|
2021-01-15 14:11:22 +03:00
|
|
|
i32 last_backing_store_serial() const { return m_last_backing_store_serial; }
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2019-01-27 10:48:34 +03:00
|
|
|
void set_global_cursor_tracking_enabled(bool);
|
2019-03-24 17:01:56 +03:00
|
|
|
void set_automatic_cursor_tracking_enabled(bool enabled) { m_automatic_cursor_tracking_enabled = enabled; }
|
|
|
|
bool global_cursor_tracking() const { return m_global_cursor_tracking_enabled || m_automatic_cursor_tracking_enabled; }
|
2019-01-27 10:48:34 +03:00
|
|
|
|
2019-02-19 03:42:53 +03:00
|
|
|
bool has_alpha_channel() const { return m_has_alpha_channel; }
|
|
|
|
void set_has_alpha_channel(bool value) { m_has_alpha_channel = value; }
|
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntSize size_increment() const { return m_size_increment; }
|
|
|
|
void set_size_increment(const Gfx::IntSize& increment) { m_size_increment = increment; }
|
2019-02-21 02:21:23 +03:00
|
|
|
|
2020-08-21 23:19:10 +03:00
|
|
|
const Optional<Gfx::IntSize>& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
|
2021-01-23 03:40:19 +03:00
|
|
|
void set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio)
|
|
|
|
{
|
|
|
|
// "Tiled" means that we take up a chunk of space relative to the screen.
|
|
|
|
// The screen can change, so "tiled" and "fixed aspect ratio" are mutually exclusive.
|
|
|
|
// Similarly for "maximized" and "fixed aspect ratio".
|
|
|
|
// In order to resolve this, undo those properties first:
|
|
|
|
set_untiled(position());
|
|
|
|
set_maximized(false);
|
|
|
|
m_resize_aspect_ratio = ratio;
|
|
|
|
}
|
2020-08-21 23:19:10 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntSize base_size() const { return m_base_size; }
|
|
|
|
void set_base_size(const Gfx::IntSize& size) { m_base_size = size; }
|
2019-02-21 02:21:23 +03:00
|
|
|
|
2020-02-06 13:56:38 +03:00
|
|
|
const Gfx::Bitmap& icon() const { return *m_icon; }
|
|
|
|
void set_icon(NonnullRefPtr<Gfx::Bitmap>&& icon) { m_icon = move(icon); }
|
2019-07-28 11:18:49 +03:00
|
|
|
|
2019-04-13 17:59:55 +03:00
|
|
|
void set_default_icon();
|
2019-03-07 01:03:36 +03:00
|
|
|
|
2020-09-10 21:55:39 +03:00
|
|
|
const Cursor* cursor() const { return m_cursor.ptr(); }
|
|
|
|
void set_cursor(RefPtr<Cursor> cursor) { m_cursor = move(cursor); }
|
2019-04-01 00:52:02 +03:00
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
void request_update(const Gfx::IntRect&, bool ignore_occlusion = false);
|
2020-02-06 13:56:38 +03:00
|
|
|
Gfx::DisjointRectSet take_pending_paint_rects() { return move(m_pending_paint_rects); }
|
2019-04-20 18:19:56 +03:00
|
|
|
|
2020-08-18 22:33:43 +03:00
|
|
|
bool has_taskbar_rect() const { return m_have_taskbar_rect; };
|
2019-12-03 23:34:34 +03:00
|
|
|
bool in_minimize_animation() const { return m_minimize_animation_step != -1; }
|
|
|
|
int minimize_animation_index() const { return m_minimize_animation_step; }
|
|
|
|
void step_minimize_animation() { m_minimize_animation_step += 1; }
|
2020-08-18 22:33:43 +03:00
|
|
|
void start_minimize_animation();
|
2019-12-03 23:34:34 +03:00
|
|
|
void end_minimize_animation() { m_minimize_animation_step = -1; }
|
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntRect tiled_rect(WindowTileType) const;
|
2020-03-14 01:21:24 +03:00
|
|
|
void recalculate_rect();
|
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
// For InlineLinkedList.
|
2020-02-06 22:03:37 +03:00
|
|
|
// FIXME: Maybe make a ListHashSet and then WindowManager can just use that.
|
|
|
|
Window* m_next { nullptr };
|
|
|
|
Window* m_prev { nullptr };
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2020-02-15 02:10:34 +03:00
|
|
|
void detach_client(Badge<ClientConnection>);
|
2020-01-25 12:25:49 +03:00
|
|
|
|
2020-05-01 23:59:38 +03:00
|
|
|
Window* parent_window() { return m_parent_window; }
|
|
|
|
const Window* parent_window() const { return m_parent_window; }
|
|
|
|
|
|
|
|
void set_parent_window(Window&);
|
|
|
|
|
2020-05-02 00:12:15 +03:00
|
|
|
Vector<WeakPtr<Window>>& child_windows() { return m_child_windows; }
|
|
|
|
const Vector<WeakPtr<Window>>& child_windows() const { return m_child_windows; }
|
|
|
|
|
2020-07-15 04:17:00 +03:00
|
|
|
Vector<WeakPtr<Window>>& accessory_windows() { return m_accessory_windows; }
|
|
|
|
const Vector<WeakPtr<Window>>& accessory_windows() const { return m_accessory_windows; }
|
|
|
|
|
2020-07-16 18:39:52 +03:00
|
|
|
bool is_descendant_of(Window&) const;
|
|
|
|
|
2020-07-15 04:17:00 +03:00
|
|
|
void set_accessory(bool accessory) { m_accessory = accessory; }
|
2020-07-15 19:13:13 +03:00
|
|
|
bool is_accessory() const;
|
2020-07-15 04:17:00 +03:00
|
|
|
bool is_accessory_of(Window&) const;
|
|
|
|
|
2020-05-02 00:26:32 +03:00
|
|
|
void set_frameless(bool frameless) { m_frameless = frameless; }
|
|
|
|
bool is_frameless() const { return m_frameless; }
|
|
|
|
|
2020-05-30 23:08:26 +03:00
|
|
|
int progress() const { return m_progress; }
|
|
|
|
void set_progress(int);
|
|
|
|
|
2020-07-16 20:08:39 +03:00
|
|
|
bool is_destroyed() const { return m_destroyed; }
|
|
|
|
void destroy();
|
|
|
|
|
2020-07-31 04:52:45 +03:00
|
|
|
bool default_positioned() const { return m_default_positioned; }
|
|
|
|
void set_default_positioned(bool p) { m_default_positioned = p; }
|
|
|
|
|
2020-08-18 07:45:10 +03:00
|
|
|
bool is_invalidated() const { return m_invalidated; }
|
|
|
|
|
|
|
|
bool is_opaque() const
|
|
|
|
{
|
|
|
|
if (opacity() < 1.0f)
|
|
|
|
return false;
|
|
|
|
if (has_alpha_channel())
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Gfx::DisjointRectSet& opaque_rects() { return m_opaque_rects; }
|
|
|
|
Gfx::DisjointRectSet& transparency_rects() { return m_transparency_rects; }
|
|
|
|
Gfx::DisjointRectSet& transparency_wallpaper_rects() { return m_transparency_wallpaper_rects; }
|
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
private:
|
2020-02-06 22:03:37 +03:00
|
|
|
void handle_mouse_event(const MouseEvent&);
|
2020-01-04 16:14:36 +03:00
|
|
|
void update_menu_item_text(PopupMenuItem item);
|
|
|
|
void update_menu_item_enabled(PopupMenuItem item);
|
2020-05-01 23:59:38 +03:00
|
|
|
void add_child_window(Window&);
|
2020-07-15 04:17:00 +03:00
|
|
|
void add_accessory_window(Window&);
|
2020-07-07 21:09:18 +03:00
|
|
|
void ensure_window_menu();
|
2020-07-16 02:40:52 +03:00
|
|
|
void modal_unparented();
|
2019-03-24 17:01:56 +03:00
|
|
|
|
2020-02-06 22:03:37 +03:00
|
|
|
ClientConnection* m_client { nullptr };
|
2020-05-01 23:59:38 +03:00
|
|
|
|
|
|
|
WeakPtr<Window> m_parent_window;
|
|
|
|
Vector<WeakPtr<Window>> m_child_windows;
|
2020-07-15 04:17:00 +03:00
|
|
|
Vector<WeakPtr<Window>> m_accessory_windows;
|
2020-05-01 23:59:38 +03:00
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
String m_title;
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntRect m_rect;
|
|
|
|
Gfx::IntRect m_saved_nonfullscreen_rect;
|
|
|
|
Gfx::IntRect m_taskbar_rect;
|
2020-08-18 07:45:10 +03:00
|
|
|
Gfx::DisjointRectSet m_dirty_rects;
|
|
|
|
Gfx::DisjointRectSet m_opaque_rects;
|
|
|
|
Gfx::DisjointRectSet m_transparency_rects;
|
|
|
|
Gfx::DisjointRectSet m_transparency_wallpaper_rects;
|
2020-02-06 22:03:37 +03:00
|
|
|
WindowType m_type { WindowType::Normal };
|
2019-01-27 10:48:34 +03:00
|
|
|
bool m_global_cursor_tracking_enabled { false };
|
2019-03-24 17:01:56 +03:00
|
|
|
bool m_automatic_cursor_tracking_enabled { false };
|
2019-02-11 11:47:10 +03:00
|
|
|
bool m_visible { true };
|
2019-02-19 03:42:53 +03:00
|
|
|
bool m_has_alpha_channel { false };
|
2019-03-19 02:52:39 +03:00
|
|
|
bool m_modal { false };
|
2020-01-04 14:12:02 +03:00
|
|
|
bool m_minimizable { false };
|
2020-05-02 13:15:48 +03:00
|
|
|
bool m_frameless { false };
|
2019-03-19 02:52:39 +03:00
|
|
|
bool m_resizable { false };
|
2020-08-21 23:19:10 +03:00
|
|
|
Optional<Gfx::IntSize> m_resize_aspect_ratio {};
|
2019-04-04 02:44:35 +03:00
|
|
|
bool m_listens_to_wm_events { false };
|
2019-04-05 23:32:00 +03:00
|
|
|
bool m_minimized { false };
|
2019-05-12 22:32:02 +03:00
|
|
|
bool m_maximized { false };
|
2019-05-17 22:33:44 +03:00
|
|
|
bool m_fullscreen { false };
|
2020-07-15 04:17:00 +03:00
|
|
|
bool m_accessory { false };
|
2020-07-16 20:08:39 +03:00
|
|
|
bool m_destroyed { false };
|
2020-07-31 04:52:45 +03:00
|
|
|
bool m_default_positioned { false };
|
2020-08-18 22:33:43 +03:00
|
|
|
bool m_have_taskbar_rect { false };
|
2020-08-18 07:45:10 +03:00
|
|
|
bool m_invalidated { true };
|
|
|
|
bool m_invalidated_all { true };
|
|
|
|
bool m_invalidated_frame { true };
|
2020-01-01 20:24:14 +03:00
|
|
|
WindowTileType m_tiled { WindowTileType::None };
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntRect m_untiled_rect;
|
2019-12-27 13:34:40 +03:00
|
|
|
bool m_occluded { false };
|
2020-02-06 13:56:38 +03:00
|
|
|
RefPtr<Gfx::Bitmap> m_backing_store;
|
|
|
|
RefPtr<Gfx::Bitmap> m_last_backing_store;
|
2021-01-15 14:11:22 +03:00
|
|
|
i32 m_backing_store_serial { -1 };
|
|
|
|
i32 m_last_backing_store_serial { -1 };
|
2019-01-16 18:03:50 +03:00
|
|
|
int m_window_id { -1 };
|
2020-01-25 12:25:49 +03:00
|
|
|
i32 m_client_id { -1 };
|
2019-02-19 03:42:53 +03:00
|
|
|
float m_opacity { 1 };
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntSize m_size_increment;
|
|
|
|
Gfx::IntSize m_base_size;
|
2020-02-06 13:56:38 +03:00
|
|
|
NonnullRefPtr<Gfx::Bitmap> m_icon;
|
2020-09-10 21:55:39 +03:00
|
|
|
RefPtr<Cursor> m_cursor;
|
2020-02-06 22:03:37 +03:00
|
|
|
WindowFrame m_frame;
|
2019-04-20 15:40:38 +03:00
|
|
|
unsigned m_wm_event_mask { 0 };
|
2020-02-06 13:56:38 +03:00
|
|
|
Gfx::DisjointRectSet m_pending_paint_rects;
|
2020-06-10 11:57:59 +03:00
|
|
|
Gfx::IntRect m_unmaximized_rect;
|
|
|
|
Gfx::IntRect m_rect_in_menubar;
|
2020-02-06 22:03:37 +03:00
|
|
|
RefPtr<Menu> m_window_menu;
|
2020-04-30 13:58:38 +03:00
|
|
|
MenuItem* m_window_menu_minimize_item { nullptr };
|
|
|
|
MenuItem* m_window_menu_maximize_item { nullptr };
|
2020-07-07 21:09:18 +03:00
|
|
|
MenuItem* m_window_menu_close_item { nullptr };
|
2019-12-03 23:34:34 +03:00
|
|
|
int m_minimize_animation_step { -1 };
|
2020-05-30 23:08:26 +03:00
|
|
|
int m_progress { -1 };
|
2019-01-16 18:03:50 +03:00
|
|
|
};
|
2020-02-06 22:03:37 +03:00
|
|
|
|
|
|
|
}
|