summaryrefslogtreecommitdiff
path: root/scene/main/window.cpp
AgeCommit message (Collapse)Author
2023-02-07Merge pull request #62179 from Rindbee/fix-popup_center-off-centerRémi Verschelde
Use min_size/max_size to limit window size and position while popup center
2023-02-07Use min_size/max_size to limit the window size and the position while popup ↵Rindbee
center
2023-02-07Fix Viewport::get_mouse_position for SubViewportsMarkus Sauermann
SubViewports don't have a cached mouse position available. This PR calculates the mouse position from the screen position of the mouse cursor.
2023-02-06Fix mouse/drag/touch InputEvents having no device idMarkus Sauermann
Some internally created emulated/instantiated events didn't have a device id. This PR sets for these cases a device id. Also rename `DEVICE_ID_TOUCH_MOUSE` to the more generic `DEVICE_ID_EMULATION`.
2023-02-02Remove `Viewport::_get_input_pre_xform`Markus Sauermann
This function is only relevant for `Window`. So this PR moves the functionality to the `Window`-class.
2023-02-02Simplify Viewport::_set_sizeMarkus Sauermann
`Viewport.to_screen_rect` is used only in a single location to compare it to `Rect2i()`. When called from `SubViewport`, `to_screen_rect` is always equal to `Rect2i()`. When called from `Window`, `to_screen_rect` is always different from `Rect2i()`. So the comparison `to_screen_rect != Rect2i()` can be replaced by `Object::cast_to<Window>(this)`. This allows the removal of `Viewport.to_screen_rect` and the simplification of `Viewport::_set_size`.
2023-02-01Fix stretch transform when resizing SubViewportsMarkus Sauermann
Move calculation of stretch transform from outside to inside of `Viewport::_set_size` function.
2023-01-31Remove some unused signalsRémi Verschelde
Part of #37604.
2023-01-31Fix MSVC shadow local warningRémi Verschelde
2023-01-31Merge pull request #59310 from Sauermann/proposal-event-transformRémi Verschelde
Calculate window input event transform only on window change
2023-01-27Merge pull request #71470 from YeldhamDev/window_fixesRémi Verschelde
Fix some small bugs in the `Window` node
2023-01-26Merge pull request #68627 from Sauermann/fix-tooltip-positionRémi Verschelde
Fix position of Tooltips
2023-01-26Fix position of TooltipsMarkus Sauermann
CanvasItem::get_screen_transform returns a transform from the CanvasItem to the coordinate system, where a Popup - created as a child of the CanvasItem - should be opened. get_screen_transform makes some simplifications, that work well, when used in the editor, but not in general cases. Since Popups like Tooltips are now used more commonly in projects, it becomes necessary to correct these simplifications. This solution introduces Viewport::get_popup_base_transform, which makes the necessary calculations.
2023-01-19Reorganize main and sub-window initial position properties.bruvzg
2023-01-18Fix some small bugs in the `Window` nodeMichael Alexsander
2023-01-16Add `WINDOW_FLAG_MOUSE_PASSTHROUGH` flag and enabled it for tooltips. Expose ↵bruvzg
`window_set_mouse_passthrough` to `Window`.
2023-01-07Add support for the custom initial screen for the main window, fix primary ↵bruvzg
screen detection.
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-12-29Improve `window_set_current_screen` and fix secondary window initial mode ↵bruvzg
and positions.
2022-12-07Copy local theme overrides from Control to WindowYuri Sizov
2022-12-07Rename `window_get_real_size` to `window_get_size_with_decorations`, add ↵bruvzg
`window_get_position_with_decorations`.
2022-11-14Remove redundant Variant-types initializationsMarkus Sauermann
2022-10-27Merge pull request #64710 from MinusKube/window-size-crashClay John
Prevent windows from having a size greater than device limit
2022-10-12Merge pull request #67232 from bruvzg/popup_editRémi Verschelde
Improve Popup / Window behavior in the edited scene tree.
2022-10-11Set window size after setting new limitsNikola Bunjevac
Otherwise this can fail as the size may not fit into current limits. This is problematic at least on X11.
2022-10-11Prevent `Popup`s it the edited scene tree from closing on focus loss. Hide ↵bruvzg
irrelevant `Popup` flags from the editor inspector.
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-10-03Fix invalid popup position for embedded popupsCykyrios
2022-10-01Calculate window input event transform only on window changeMarkus Sauermann
2022-09-28Merge pull request #58995 from Sauermann/fix-mouse-cursor-change-2Rémi Verschelde
Update mouse cursor shape after changes
2022-09-26Force window position if spawned outside screenkobewi
2022-09-22[macOS extend-to-title] Add scene/project name to the editor title, fix ↵bruvzg
incorrect window button position/order when system primary language is RTL.
2022-09-18Update mouse cursor shape after changesMarkus Sauermann
This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
2022-09-16Merge pull request #65496 from MinusKube/popup-capture-mouse-bugRémi Verschelde
Fix MOUSE_MODE_CAPTURED not working correctly with popups
2022-09-09Use embedding viewport instead of parent viewport to determine popup rectMinusKube
2022-09-07Fix MOUSE_MODE_CAPTURED not working correctly with popupsMinusKube
2022-09-04Prevent windows from having a size greater than device limitMinusKube
2022-09-03Un-defer the initial theme changed notification in WindowYuri Sizov
2022-09-02Un-defer the initial theme changed notificationYuri Sizov
Co-authored-by: Rindbee <idleman@yeah.net>
2022-09-02Add ThemeOwner type for managing theme propagation and lookupYuri Sizov
2022-09-01Add dumb and manual theme caching systems to WindowYuri Sizov
2022-08-30Allow to change the Stop shortcut used at runtimekobewi
2022-08-29Merge pull request #64119 from YuriSizov/theme-init-databaseRémi Verschelde
2022-08-26Merge pull request #64777 from bruvzg/extend_to_titleRémi Verschelde
[macOS] Extend editor contents to the window title bar for better space usage.
2022-08-26Add ThemeDB, expose previously static Theme methodsYuri Sizov
2022-08-26[macOS] Extend editor contents to the window titlebar for better space usage.bruvzg
2022-08-26Merge pull request #64574 from Begah/fix_transient_window_wrap_mouseRémi Verschelde
2022-08-25Refactor and remove excessive calls of `NOTIFICATION_THEME_CHANGED`Aaron Record
2022-08-25Fix warp_mouse for transient windows, smoother mouse positioning when ↵MathieuRoux
releasing mouse for spinbox
2022-08-23Avoid warnings about cursor shape change not supportedPedro J. Estébanez