Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-20Cleanup: add CTX_wm_operator_poll_msg_clearCampbell Barton
Call this function instead of `CTX_wm_operator_poll_msg_set(C, NULL)`
2021-04-19Fix drag event leaving the gizmo not under the cursor highlightedCampbell Barton
Prevent drag events from changing the highlighted gizmo unless the drag event activates the gizmo. This resolves a glitch where testing a drag event would highlight at the point the drag was initiated even when the event was not handled.
2021-04-19Cleanup: re-order gizmo handling checksCampbell Barton
Non-functional change in preparation for fix.
2021-04-16Fix missing owner_id values from 919558854d624f5db40acfa9f5674ac8c94873b6Campbell Barton
This prevented dynamic enum callbacks being called.
2021-04-16WM: prevent drag events being continually testedCampbell Barton
Click-drag events that weren't handled would continually be tested for each mouse-motion event. As well as being redundant, this added the overhead of querying gizmos twice per motion event. Now click-drag is only tested once when the drag threshold is reached. This mitigates T87511, although the single drag test still causes the snap gizmo to flicker.
2021-04-11Cleanup: use ELEM, STREQ macrosCampbell Barton
2021-03-24Cleanup: use new BLI_assert_unreachable macroCampbell Barton
2021-03-15Fix regression with modal operator file load checkCampbell Barton
As of 2cc5af9c553cfc00b7d4616445ad954597a92d94, checking the window managers pointer for changes is no longer a valid way to check a file has been loaded.
2021-03-15Cleanup: update comments, remove ifdef'd codeCampbell Barton
2021-03-11Fix missing UI updates, caused by own earlier commitJulian Eisel
Caused by 46aa70cb486d. RNA would send property update notifiers with the owner ID as `reference` data. Since above's commit we'd only send the notifiers to editors if the reference data address matches the space's address. So editors wouldn't get the notifiers at all. The owner ID for space properties is always the screen AFAIK. So allow notifiers with the screen as reference to be passed to editors as well, think this is reasonable to do either way. For example, steps to reproduce were: * Open Asset Browser * Mark some data-blocks of different types as assets (e.g. object & its material) * Switch between the categories in the Asset Browser. The asset list wouldn't be updated.
2021-03-11UI: Avoid unnecessary redraws of unrelated editors on space changesJulian Eisel
When adding a notifier, `reference` data can be passed. The notifier system uses this to filter out listeners, for example if data of a scene changes, windows showing a different scene won't get the notifiers sent to their listeners. For the `NC_SPACE` notifiers, a number of places also passed the space as `reference`, but that wasn't used at all. The notifier would still be sent to all listeners in all windows (and the listeners didn't use it either). Causing some unnecessary updates (e.g. see ed2c4825d3e2344). With this commit, passing a space will make sure the notifier is only sent to that exact space. Some code seems to already have expected that to be the case. However there were some cases that passed the space as `reference` without reason, which would break with this commit (meaning they wouldn't redraw or update correctly). Corrected these so they don't pass the space anymore.
2021-03-11Cleanup: Typos in comments (window-manager files)Julian Eisel
Typos from a509e79a4c77. Looks like issues with an automated cleanup tool.
2021-03-08Fix T86384: Click detection fails in some cases with modifiersCampbell Barton
Regression in b5d154f400e46ba322f0e08a231bb2557bf51a1e
2021-03-06Cleanup: rename wm_get_cursor_positionCampbell Barton
Match naming of other wm_cursor_position_* functions.
2021-03-05Cleanup: remove redundant NULL window checks handling eventsCampbell Barton
2021-03-05Cleanup: move check_drag & check_click out of wmEventCampbell Barton
These variables track the wmWindow.event_queue state, however they were used in a way that wasn't correct. - check_drag & check_click from wmWindow.eventstate were used to track the click/drag status of events handled in wmWindow.event_queue. - Event's in the queue read from wmEvent.check_drag. - Once a drag action was detected, wmWindow.eventstate.check_drag was disabled. Disabling drag in the event state would not change the drag state for values already in the event queue. Simplify logic by moving these values into the window, so there is one place these variables are tracked.
2021-03-05Cleanup: disambiguate 'queue' struct membersCampbell Barton
The term queue isn't very descruptive on it's own, use: - wmWindow.event_queue - wmWindowManager.notifier_queue
2021-03-05Cleanup: rename event to event_typeCampbell Barton
Reserve `event` for wmEvent.
2021-03-05Cleanup: rename variables in wm_event_add_ghosteventCampbell Barton
Using both evt and event together was confusing. Renamed: - event_state <- evt - event_state_other <- oevt - event_other <- oevent - win_other <- owin
2021-03-02Fix click-drag regression in fix for T86116Campbell Barton
1638af109e46522a1a24645289016922bb9ca977 & bfc70a6a958b9c35bde765ea8a02e8b1fd36db8b caused a regression with click-drag (not tweak which has it's own logic). Restore some changes from these commits with added comments. Minor changes from previous functionality from 39919e35326c732141bfd2d740b19000b6bc1d51. - `prevval` & `prevtype` are now set for all kinds of new events in the queue previously this was not done for some kinds of events (mouse wheel, ndof - for example). - Set `prevval` & `prevtype` for other windows for mouse buttons.
2021-03-02WM: log errors when wmWindow.eventstate values are invalidCampbell Barton
Ensure they're working as documented (only for debug builds).
2021-03-02WM: window.event_simulate now sets previous values properlyCampbell Barton
Match wm_event_add_ghostevent behavior for setting previous values.
2021-03-02WM: use wmEvent.is_repeat instead of previous event checksCampbell Barton
This check was added before is_repeat was supported, use this variable instead since it's more a more reliable way of detecting held keys. Also remove outdated comment.
2021-03-01Fix T86116: Failure to detect click events with modifier heldCampbell Barton
Click detection logic relied on the event queue not accumulating events as newly added events at the end of the queue adjusted `wm->eventstate->prev{val/type}` which was then compared with events at the front of the queue. This made Ctrl-Click fail to detect the click as releasing Ctrl set the previous value before the previous event was handled. In practice this only happened in heavy scenes, updating 10 fps or lower. It also made automated tests fail that accumulate events before handling them.
2021-03-01WM: set previous values for events in the event queueCampbell Barton
This makes event's prevval and prevtype usable for events in the queue. Previously they were unused, except as a hack for modal keymap handling. This is needed to fix T86116, where the `wm->eventstate->prev{val/type}` are set to values from events that have not been processed.
2021-03-01WM: prevent model keymap handling overwriting previous event valuesCampbell Barton
`wmEvent.prevtype` & `wmEvent.prevval` were overwritten when used in modal keymaps. Now they are restored to their original values.
2021-03-01Cleanup: move logic to copy the previous event state to a functionCampbell Barton
2021-03-01Cleanup: minor change to click detection checksCampbell Barton
Change order of checks for more convenient click-detection debugging.
2021-03-01WM: don't set event prevval/prevtype on cursor motionCampbell Barton
Currently the intended behavior regarding prevval/prevtype isn't handled consistently. However, including cursor motion causes events in `wm->queue` and `wm->eventstate` to behave differently, where `wm->eventstate` ignores motion (necessary for click detection). This makes checks from `wm->eventstate` to events in the queue fail. This reverts 39919e35326c732141bfd2d740b19000b6bc1d51, using the `event.type` instead of it's previous type. This works as it includes mouse button release events.
2021-02-27Fix error converting simulated events press/release to clicksCampbell Barton
Move logic that sets previous event state into WM_event_add_simulate.
2021-02-20Cleanup: doxygen sectionsCampbell Barton
2021-02-16Assets: Remove appended asset when dropping operation failsJulian Eisel
When dropping an asset somewhere, it is appended and then a drop operation is called to actually add it to the scene based on current context. If this drop operation fails, the appended data-block is now still in the .blend. The user may not notice and not expect this. Instead idea is to rollback any changes done by dropping code if the operation fails, namely removing the appended data-block again. Adds a new `cancel()` callback which is called if the drop operator returns `OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets on drop failure. Also removes the `free_id_on_error` property of the `NODE_OT_add_group` operator, which was used as ad-hoc solution to get this same behavior.
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2021-01-29Merge branch 'blender-v2.92-release'Brecht Van Lommel
2021-01-24Asset Browser: Avoid appending asset data-block when drop operator will failJulian Eisel
For assets, the copy callback of the drop-box would append the asset data-block. Check if the operator's poll succeeds before calling the copy callback. Otherwise the data-block is "secretly" appended, which the user doesn't expect and won't notice without checking the file data in the Outliner. For masks I had to extend the poll function, it didn't check context sufficiently.
2021-01-19UI Code Quality: Use "params" struct for area and region callbacksHans Goudey
These functions with many arguments can be unwieldy. Aside from the obvious issues with rewriting the list of arguments and the opportunities for error and frustration that presents, the long list of arguments make these systems hard to change. So when an argument should be added, someone might skip that and add some hack instead. So, as proposed in T73586#1037210, this patch instead uses a "params" struct for each of these callbacks. - Use param argument for `ARegionType.listener` - Remove unused window field in region listener - Use param argument for `SpaceType.listener` - Use params struct for `ARegionType.message_subscribe` Differential Revision: https://developer.blender.org/D9750
2020-12-27Fix crash when saving render from temporarily maximized render windowJulian Eisel
Steps to reproduce were: * Start with factory defaults * Set "Render in" to "Maximized Area" * Render * Open "Save as" * Click Cancel Mistake in 78d2ce19c4fb. Was using the wrong area pointer, which I think didn't make a difference in most cases, but here it did.
2020-12-23Fix T84013: Crash closing maximized File Browser opened from PreferencesJulian Eisel
After 1e799dd26ec1, the logic to recognize a temporary File Browser window didn't work correctly anymore. It would recognize a maximized File Browser inside a temporary window as a temporary File Browser window, and attempt to close this (rather than returning to the previous layout). The logic there was pretty weak, and still is I think. A more stable solution would need bigger refactoring. With this, it's also not possible to maximize or fullscreen an area within a temporary window (Preferences, File Browser, render window) anymore. Think that won't make a noticable difference, since you couldn't open multiple areas there anyway, and the area seems to be maximized already. Cleaned up the code a bit to not become more confusing with the changes.
2020-12-22WM: minor optimization for when there is a large number of notifiersBrecht Van Lommel
Don't add the same stats refresh notifiers multiple times, it can be slow to search the full list of notifiers for duplicates when there are many. Fundamentally the time complexity in searching for duplicates is still bad. Inspired by D9901 from Erik Abrahamsson
2020-12-19Cleanup: Use true and false for booleansHans Goudey
2020-12-16Fix T83851: Python: operator macros cause a crashPhilipp Oeser
Caused by rB7447eb7e7430. This is just a copy-paste error [previous LISTBASE_FOREACH substitution of marco loop in that file has a different starting point which is not appropriate here] Maniphest Tasks: T83851 Differential Revision: https://developer.blender.org/D9872
2020-12-15Fix crash selecting custom asset preview from maximized File BrowserJulian Eisel
If Preferences > Interface > Temporary Editors > File Browser is set to "Maximized Area", "Load Custom Preview" in the Asset Browser would crash after selecting the file. 1e799dd26ec1e848 was important to get this issue fixed. This commit just ensures the file-list is recreated correctly after closing the temporary File Browser, so the custom preview operator can execute on valid context.
2020-12-04Fix incorrect variable name after last commitHans Goudey
2020-12-04Cleanup: Use LISTBASE_FOREACH macro in windowmanager internHans Goudey
Also decrease the scope of variables related to the loops.
2020-12-04Revert "Fix T83177: Industry Compatible keymap: MMB-dragging to transform ↵Germano Cavalcante
engages axis-constraining on release" This reverts commit c0677b662f4b13429c0738b99ace85403385ff38.
2020-11-30Fix T83177: Industry Compatible keymap: MMB-dragging to transform engages ↵Germano Cavalcante
axis-constraining on release Release confirm did not consider modal keymap events.
2020-11-30Cleanup: Use "region" for ARegion variable namesHans Goudey
As proposed in T74432 and already implemented in several commits, "region" is the preferred name for `ARegion` variables, rather than any variant of "ar". This commit changes a few "ar" variables that have popped up over time and also adjusted names of variants like "arnew".
2020-11-16Fix T76699: Support macOS inbetween mouse/tablet.Nicholas Rishel
Coalescing on macOS overwrites a singular unprocessed mouse event. To receive all mouse and tablet events coalescing is disabled. Disabling coalescing for macOS disables coalescing for trackpad gestures. Repeat trackpad events are unnecessary and found to negatively impact performance thus are re-coalesced in Window Manager. Reviewed By: brecht Differential Revision: https://developer.blender.org/D9574
2020-11-09macOS: follow system preference for natural trackpad scroll directionYevgeny Makarov
And remove Blender preference, which was expected to be set to match the system preference for correct behavior. Instead just handle this automatically. Differential Revision: https://developer.blender.org/D9402
2020-11-03Cleanup: Use recently added helper function to find File Browser UI dataJulian Eisel
`ED_fileselect_handler_area_find()` was added in a750acab78cf and makes this case more readable and avoids code duplication as well.