Commit Graph

506 Commits

Author SHA1 Message Date
Nathan Letwory
b6a6074b56 Change window checks to desktop size instead of screen size.
This allows to open windows stretched over monitors. Saving
stretched layouts open correctly as well.

Renamed screensize_all to desktopsize to better convey meaning.
2013-09-10 06:32:32 +00:00
60da8c1ae0 Fix #36593: crash duplicating window on OS X in some situations. User data
should be set before GHOST_SetWindowState, since this may generate an event.
2013-09-09 16:55:35 +00:00
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
02608d257a add api call for initializing events from the windows eventstate. 2013-07-29 08:29:04 +00:00
a6b505ef0b style cleanup 2013-06-06 06:02:46 +00:00
601e5ad2f4 Fix #35624: rendering to a new window, then switching scene in the main window,
would still continue to render the previous scene in the render window on F12.
2013-06-04 15:36:00 +00:00
c6d1b6c3fc Bug fix, own collection while testing
New OSX "Life resize" was also being called during opening of windows - when things are
not initialized yet. Crashed on opening full-screen window (which is animated in OSX).
2013-06-01 15:24:15 +00:00
b9817cd207 Live resize on Windows. Based on Ton's patch for mac.
Removing old resize stuff. 
Windows has resize lag, which creates black gap with openGL. Still looking to fix it.
2013-05-25 21:59:34 +00:00
24321d4891 Solving ancient Blender window sizing issue;
- 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.
2013-05-25 14:08:56 +00:00
feeab1ad53 Fix #34997: when starting the game engine in one window and switching to a second
window, the game would stop drawing in the first and mess up the OpenGL state of
the second.

Also fixes glPushAttrib/glPopAttrib getting out of sync in some cases.
2013-04-18 16:28:39 +00:00
7bbaf4853a code cleanup: use bools in UI and WM code, quiet some shadow warnings, remove unused function uiEmboss() 2013-04-04 02:05:11 +00:00
f6025018f5 change defaults for window state on X11 (yet again), after further discussion.
instead use a fixed size as a default, clamp by the desktop size and add some padding (to account for title bar and panel).
2013-03-12 14:55:52 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
dfa8540cdf use bool for rna funcs. 2013-03-07 02:44:55 +00:00
b948c31258 revert own commit r54450, this works on X11 but not in Windows and caused bug [#34255] (which may be a bug in windows ghost?, not getting key release for modifiers).
Cross platform modifier keys on activating window better be handled at ghost level anyway.
2013-02-15 13:30:30 +00:00
48f905d806 fix for modifier keys held before a window was activated being ignored. 2013-02-11 05:55:11 +00:00
3a31e1ef27 start blender maximized on X11 - finding screen limits taking window borders, title bar, panels & multi-monitor is quite involved - without this size if often wrong.
For sizes outside the screen bounds many window managers will ignore the requested size.

Also opening maximized was default with 2.49.
2013-02-07 14:41:08 +00:00
dbf54dacf7 Add Xinerama support for GHOST_GetMainDisplayDimensions() so X11 works as it should (previously would include all monitors).
Now the active monitor size is used on startup. 
Currently the cursor position is checked for intersection with the monitor bounds to find the active screen.
2013-01-31 11:05:09 +00:00
73f301c3a8 add ghost function getAllDisplayDimensions, GHOST_GetAllDisplayDimensions
This returns the desktop size, not just the size of the active monitor, useful since this constrains the mouse and we dont have to detect the active monitor (which isn't so straightforward with xlib).

carbon/cocoa are TODO, they still use getMainDisplayDimensions().
2013-01-31 10:42:26 +00:00
4d2efa877e start window non-maximized since this is more the default state for windows. (linux/win only) 2013-01-31 09:53:34 +00:00
29456505f3 fix/workaround [#34026] Blender starts with too large window
Minimal change to stop blender window opening across all monitors.

Workaround the problem by starting maximized, and using sane defaults for non maximized window.

I checked on a few different solutions to this, Using Xinerama works OK, but with different size monitors
and not knowing which one the window-manager will pick in advance - this can be wrong too.

Now instead of opening with the screen size, just start maximized and use a default size for the non-maximized window (clamped by the screen size).

This isn't perfect since you could have 2x monitors at 1024x768, open blender, un-maximize - and blender window would cross over into the second monitor.
2013-01-31 05:37:52 +00:00
2cd25f4cf5 fix [#33836] issuing bpy.ops.render.render() in console crashes the program
don't check the event queue from threads, assert if this happens in future.
2013-01-22 02:21:21 +00:00
337695d496 draw the brush size with pressure applied (when the tablet is used), nice to see the actual size used. 2013-01-16 19:22:15 +00:00
fa759d8ffd Mac HiDPI ("retina") handling:
OK - so you have this nice crisp screen, and still you want to add extra 
monitors to the laptop! That means Blender should switch back and forth to HiDPI 
modes, when you move a window to another monitor.

This code makes the pixelsize scale factor a window property, and handles
an event when a window moves to another monitor. It then changes the
native pixelsize nicely and refreshes entire UI.

You can also have one Blender window on high, and other on low resolution.

Stretching a Blender window from 1 monitor to the other works too, but that
is Apple magic handling it.
2013-01-12 17:07:49 +00:00
472595f1d3 Bugfix #33803
(2.65a and older)

Case: ALT+CTRL+U (user prefs) made mousewheel change button values in inactive
window.

On opening 2nd window, or de-activating a window, the modifier
state was kept for that window. That meant that mouse-over in a window was using
the old modifier - for example for scrollwheel it would change values
in buttons.
2013-01-08 14:40:15 +00:00
fa28e50ac2 Region scrollbar fix!
Now scrollbars correctly hide and show, making space for the actual contents
in a region. It solves several old hacks, and puts view2d code a bit more
back in control as well. 

Implementation notes:

- The view2d mask feature is working again
- The #define V2D_SCROLL_HORIZONTAL_HIDE means: "turn on hiding".
- Code for UI_view2d_region_reinit() is enforcing better standard view settings

But... two hack/patches needed to be added:

- Region panel drawing: if after generating the button panels it appears
  a scroller hides or reveils, it calls all the generating code again.
  (a simple scale doesn't work due to rounding differences in layout code)

- View2d code that maps 'tot' and 'cur' rects: if this code detects that
  the mask changes, it calcs the map code again.

Also a bugfix (issue in 2.65)

- The left/bottom area split widget was drawing 1 pixel too large sometimes, 
  leaving bad trails on moving area dividers.
2012-12-26 13:05:39 +00:00
28cd603140 Bugfix - own collection.
Very occasionally Timer Events could still get handled, after stopping
a timer - especially with the timer event still in the queue.

This patch disables such events. Introduced a EVENT_NONE to make sure
it gets ignored everywhere.
2012-12-13 16:21:08 +00:00
e036c90253 region overlap feature missed view3d grid-scale text, increase string size for title text too. 2012-12-13 05:43:01 +00:00
96b2dc8e13 style cleanup: changes from recent commits 2012-12-13 01:00:21 +00:00
160ebfa4c4 Disable a bugfix I did - to prevent event timers to be used still.
Code looks sane, but somehow it frustrates the panel animation timer, causing
freezes now. Work for tomorrow.
2012-12-12 20:31:12 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
744378483c style cleanup 2012-11-12 03:41:25 +00:00
731e15be06 Four fixes (own collection)
- Screencast: stops working on window resize - crashes movie file output
- Screencast now draws simple brush overlay to indicate mouse cursor.
- Greasepencil now works again to use MMB for view rotates
  (and missed proper redraw signal for toolbar, at end of paint)
2012-11-11 18:33:35 +00:00
886dcf617e MultiSample feature: added provision that requires a restart in order to get
it work properly - you cannot set/disable it in a running program with windows
open. 

In short: Multisample setting is static, set on first time running of Blender,
after reading the user preferences.

For as far as I can see - disabling/enableing (glEnable) doesn't harm to be
used in drawing code. With multisample on at start, you can enable and disable it
freely. But without it set at start, enabling doesn't do anything nor draws badly.
2012-11-11 12:02:39 +00:00
c4f332084f code cleanup:
- blf doesnt have includes for TRUE/FALSE, use 1/0.
- rename ogl_multisamples -> multi_sample, also shorten enum strings.
2012-11-11 10:55:32 +00:00
4121e4b7e7 Added UI support to set OpenGL MultiSample.
Code to support it was lying around for long already, but not controlled by UI nicely.
Now you have in user preferences "System" tab an option to set it. 

NOTE:
- it only works saving as User startup.blend, and restart Blender.
- your system should support it, no check for it is visible in UI
- tested only on iMac OSX 10.7

Screenshot:
http://www.blender.org/bf/chinchilla.blend.png
2012-11-10 11:55:45 +00:00
818e9ff88d Bugfix #33038
TIMER events could get keymodifier set - in this case the user assigned
spacebar modifier for setting views (running smoothview timer)

Also: cleaned op old hacks from event checking code. 
The rule should be:

1) generate event properly, frozen state
2) pass on to handlers without exceptions or changing internal state

The only exception currently is for the "CLICK" (map key-release to unhandled
key-press).

Also: made --debug-event print OK. Slight cleanup in eventprinting in general.
It was putting the wmEvent state print in wrong place, doing it 4 or 8 times.
2012-11-01 15:51:24 +00:00
dbde62d124 fix [#30087] operator_context is different for popup and submenu's *TODO, after 2.62*
having context different for menu vs submenu is quite confusing, now they are both: WM_OP_INVOKE_REGION_WIN
this changes WM_menu_invoke behavior.
2012-10-26 06:22:54 +00:00
7c846bbe75 add section on how to run scripts in blender for the API intro, found there were no simple docs like this in the wiki.
also set the window type to normal on start when -p argument is given, since the view could be maximized/fullscreen.
2012-10-24 16:55:06 +00:00
f07b291591 fix for maximized startup blend preventing -p command line argument from working. 2012-10-24 16:15:36 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
c80c4c896a Fix file descriptor leak in BLI_file_ungzip_to_mem and small memleak in wm_window_title. 2012-10-07 15:39:47 +00:00
ed1cda9a6c style cleanup 2012-09-30 06:12:47 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
1a7eb3454e style cleanup 2012-09-08 08:59:47 +00:00
cb21d3f670 Code cleanup: remove some unused code. 2012-08-24 12:10:38 +00:00
26f073b327 macros for rectangle center and size 2012-08-20 15:29:02 +00:00
c567cf3fab code cleanup: WM naming conventions 2012-08-11 21:35:24 +00:00
468ef74ed7 More spell and typo fixes (mostly visualise->visualize, grey->gray, normalise->normalize). 2012-07-03 19:09:07 +00:00