Reported by holy enigma
The previous commit in this area removed bounding box checks, because
they were done against primary monitor. Now do bound checks against
the entire desktop, or rather, the virtual screen. This is the bounding
rectangle of all the monitors.
This should ensure windows are always created within the confines of this
area.
On Windows the system window will be sized an positioned such that Blender screen area lower left
corner is at the requested location, and with dimension as requested.
Thanks to Alexander N. for reporting and Brecht van Lommel for input.
This should be (and is) done by the caller instead (windowmanager)
to ensure new windows fit properly on the desktop. Saving
stretched layouts and layouts with window over display
boundaries now becomes possible on Windows too.
The reason of this is because PATH_MAX is not guaranteed
to be defined on all platforms and Hurd doesn't define it.
So either we need to support arbitrary long file path or
we need to define own maximum path length.
The rule here would be:
- If it's not big trouble to support arbitrary long paths
(i.e. in ghost by using std::string instead of char*)
then arbitrary long path shall be implemented.
- For other cases to use PATH_MAX please include BLI_fileops.h
which takes care of making sure PATH_MAX is defined.
Additional change: get rid of own changes made yesterday
which were supposed to make storage.c work fine in cases
PATH_MAX is not define, but on the second though it lead
to unneeded complication of the code.
Thanks Campbell for review!
- Removed grid-snapping for area coordinates on scaling windows.
That caused the areas to shrink or expand, and eventually corrupt screen layouts.
- Added simple but efficient life resize for OSX. I need to know why this is so much
code for Windows... I suggest Windows to just copy same method; dispatch the queue,
and just let the event system draw.
* Also do pressure interpolation for brush size and spacing.
* Do smoothing of pressure when smooth stroke and sample average is enabled.
* Revert the OS X specific pressure change to pressure ^ 2.5, for low pressure
values like 0.05 it makes the pressure 100x lower, which is problematic. If
we need to adjust the pressure curve it should be done for all platforms.
Still weak:
* Pressure of first touch on tablet is difficult to control, usually it's low
which makes the stroke start out small or soft, but other times not. Finer
event capturing at ghost level would help, along with pressure changes without
mouse movement, but this may also need different paint stroke logic.
* Brush radius is rounded to integers, this gives noticeable stepping.
* Brush falloff is not antialiased, gives noticeable aliasing for small brush
sizes which was always a problem, but is more common with size pressure control.
Another issue with the recent Ghost changes here. For some reason key up events
are not coming through when the command key is pressed. I can't figure out why,
for now just always handle them, still fixes the original bug.
interact better with system shortcuts.
This is a special shortcut for switching between views and does not get
delivered directly to our view when we pass it through the application key
event handling path. We only have a single OpenGL view, so there's no need to
pass it on to the application, instead just interpret it directly.
insert text in the text editor and do the associated operation like minimizing the
window or switching windows.
The code was always doing both without trying to ensure only one is done. Now we
integrate a bit better with the event handling and pass the event to NSApp, which
then decides to handle the event itself or pass it on to the window, from where
we then send it back to be handled.
fullscreen option. It was possible to enable both at the same time which got
you stuck in a state where it was impossible to exit fullscreen. Now I've made
them mutually exlusive, only one can be enabled at the same time.
Note the reason we need to support both is because the new Lion fullscreen does
not work with multiple monitors, it will just give black screens on the other
monitors. This is a limitation of OS X, you can find many complaints about this
online.