Commit Graph

1262 Commits

Author SHA1 Message Date
Campbell Barton
697d4b227e Ghost/X11: correct function signature 2018-08-08 17:54:41 +10:00
Campbell Barton
931a279f44 Cleanup: use static variables 2018-08-08 11:00:57 +10:00
Sergey Sharybin
e6af8758c8 Ghost: Fix memory leak happening with keyboard mapping access
So far only noticed system de-initialization doesn't perform full
object free. So rather harmless but yet stupid.
2018-07-16 17:32:57 +02:00
Sergey Sharybin
719629f2aa GHOST: Fix memory leak in X11 DPI query
The X resource database is to be explicitly destroyed. This fixes 46 bytes
leak per every window DPI query (which happens a lot on window move/resize
and even on areas resize).

Unfortunately, this does not fully fix the leak since the known leak:

  https://bugs.freedesktop.org/show_bug.cgi?id=94604
2018-07-10 10:59:06 +02:00
Campbell Barton
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
Campbell Barton
9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
Campbell Barton
6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
Campbell Barton
f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
Campbell Barton
540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
Campbell Barton
4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
Campbell Barton
cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
Campbell Barton
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
Sergey Sharybin
1a3fb3e8b1 Fix wrong comparison of drop target URI on X11
Need to compare, NOT to override passed file name.
2018-05-07 14:11:33 +02:00
4bd5b824b0 Fix missing confirm quit dialog on macOS, after recent changes. 2018-03-28 10:54:17 +02:00
Sergey Sharybin
3c45fdd171 GHOST: Solve compilation error of test programs 2018-03-26 14:51:56 +02:00
Campbell Barton
5ba5254ec1 UI: Optional prompt to quit for non win32 systems
D566 by @januz

Use Blender native dialog when OS dialog's aren't supported.
2018-03-21 16:04:01 +01:00
Lukas Stockner
41149ca134 GHOST: Support Unity taskbar progress API
Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3106
2018-03-15 22:49:56 +01:00
Arto Kitula
076abf6cd8 MacOS: Use correct Cocoa protocol on any compiler 2017-10-31 11:30:55 +02:00
Arto Kitula
1effab7809 Fix T52984. Trackpad rotation to natural direction 2017-10-26 23:11:25 +03:00
Campbell Barton
2103194f79 Fix T53004: XWayland ignores cursor-warp calls
There is currently a limitation in XWayland,
the cursor needs to be hidden during warp calls.
2017-10-25 20:12:12 +11:00
Ray Molenkamp
57d7e5b6ee Fix T42489 and T52936: Loading blend with minimized window results in crash or empty screen on windows.
Reviewed By: @brecht , @sergey

Differential Revision: http://developer.blender.org/D2866
2017-10-04 11:44:22 -06:00
Campbell Barton
5a1954a5cb Drop platform support for Solaris & AIX
These platforms didn't see maintenance in years.
This commit just removes ifdef's & cmake check.
2017-09-29 19:16:34 +10:00
c10ac1bb5c macOS: officially upgrade to 10.9 libraries from lib/darwin.
This removes a bunch of code that is no longer needed, and running
"make update" will now automatically download the new libraries.

Differential Revision: https://developer.blender.org/D2861
2017-09-28 20:53:06 +02:00
Aaron Carlisle
efd5e3c254 Remove quicktime support
It has been deprecated since at least macOS 10.9 and fully removed in 10.12.

I am unsure if we should remove it only in 2.8. But you cannot build blender with it supported when using a modern xcode version anyway so I would tend towards just removing it also for 2.79 if that ever happens.

Reviewers: mont29, dfelinto, juicyfruit, brecht

Reviewed By: mont29, brecht

Subscribers: Blendify, brecht

Maniphest Tasks: T52807

Differential Revision: https://developer.blender.org/D2333
2017-09-22 16:40:05 -04:00
James Fulop
c3c0495b30 Fix T51948: pen pressure not detected with some Wacom tablets.
Generalizes current conditions, QT implements it the same way.
2017-07-24 13:54:36 +02:00
8b2785bda5 Fix T49498: continuous grab issues on macOS, particularly with gaming mouses.
Change the implementation so it no longer takes over the mouse cursor motion
from the OS, instead only move it when warping, similar to Windows and X11.
Probably the reason it was not done this way originally is that you then get
a 500ms delay after warping, but we can use a trick to avoid that and get much
smoother mouse motion than before.
2017-07-18 16:11:33 +02:00
0584c5ba8e Fix T51959: Windows + Intel GPU offset between UI drawing and mouse.
Unfortunately this means disabling the code that ensures the title
bar is properly scaled with DPI, however better to have that as a
cosmetic issue than Blender being unusable with a lot of Intel GPUs.
2017-07-08 22:11:07 +02:00
Campbell Barton
72c9141a7a Cleanup: doxygen comments
Also remove duplicate & mismatching comments from grease-pencil header.
Keep comments close to implementation to avoid getting out of sync.
2017-06-19 10:04:30 +10:00
Mike Erwin
6757ca8b40 NDOF: clean up after MinGW removal
Follow up to 9f044cb422c1fc9ad79278092445f612342abb59

These comments described the difference between Microsoft & MinGW's struct definition. Now that we dropped MinGW we don't need to go into these details.
2017-05-29 14:04:46 -04:00
Aaron Carlisle
9f044cb422 Remove MinGW support
The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.


Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648
2017-05-27 15:34:55 -04:00
393efccb19 Fix GHOST crash on X11 with recent DPI changes on some systems. 2017-03-25 19:32:50 +01:00
Wouter
fe3fb23697 Automatic DPI for all platforms, per monitor DPI for Windows.
For Windows 8.1 and X11 (Linux, BSD) now use the DPI specified by the operating
system, which previously only worked on macOS. For Windows this is handled per
monitor, for X11 this is based on Xft.dpi or xrandr --dpi. This should result
in appropriate font and button sizes by default in most cases.

The UI has been simplified to a single UI Scale factor relative to the automatic
DPI, instead of two DPI and Virtual Pixel Size settings. There is forward and
backwards compatibility for existing user preferences.

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D2539
2017-03-25 11:22:16 +01:00
lazydodo
05b181fbc5 Fix T46795 : Reset GWLP_USERDATA to NULL at window destruction so any future events will not try to reference this deleted class. 2016-11-30 18:26:25 -07:00
Campbell Barton
53a1b48321 GHOST/X11: Incorrect WM_STATE access
This worked by accident because of struct padding,
treat state as a CARD32 as documented.

Matches wine-x11 usage.
2016-11-20 09:03:51 +11:00
74e0f900c5 Fix a few compile errors with C++11 on macOS. 2016-10-08 15:03:53 +02:00
lazydodo
26d7d995db Fix Windows mouse wheel scroll speed
In Windows, event dispatching code is throwing out the wheel scroll count value.
Despite of how many fast you move the wheel, it only make one-notch scroll event.

This patch convert wheel event to multiple 1-notch wheel events.

This also correct the handling of smooth scroll mouse wheel (which can report smaller than 1-notch wheel movement) by accumulating the small wheel delta values.

Reviewers: djnz, shadowrom, elubie, #platform:_windows, sergey, juicyfruit, brecht

Reviewed By: shadowrom, elubie, #platform:_windows, brecht

Subscribers: dingto, elubie, brachi, brecht

Differential Revision: https://developer.blender.org/D143
2016-09-28 17:22:02 -06:00
Mike Erwin
5d0de39238 fix Mac build for Xcode < 8
We need a long-term fix, but this will get 2.78 out the door.
2016-09-27 16:16:47 +02:00
Mike Erwin
2ebb367b0f cleanup: spacing & alignment 2016-09-27 14:56:58 +02:00
Mike Erwin
e12f5b699d OpenGL: software renderer for old Mac GPUs
We raised the minimum to GL 2.1 in Blender 2.77, and dropped support for older GPUs (pre-2012 Intel mostly). On Windows you get a popup message, but on Mac we simply crashed. Every Mac has a builtin software renderer for GL 2.1 so let's use that when the GPU is not capable!

Run blender --debug-gpu to see version detection & software fallback.
2016-09-19 20:27:12 +02:00
Martijn Berger
cc9d0eff81 Lowercase includes for psapi.h and dbghelp.h windows includes.
This makes cross compilation a little less painful
2016-09-19 14:22:38 +02:00
Mike Erwin
804f6bf31e fix Mac build with Xcode 8
Small issues in GHOST
- use NSApplicationDelegate protocol for our app delegate
- make sure NSApp is initialized before using
(cherry picked from commit df7be04ca6d4b6dccc998445386228699d72d072)
2016-09-14 16:35:01 +02:00
Bastien Montagne
037df2aaa6 Fix T49303: Fix T49314: More issues with new handling of X11 shortcuts.
This commits changes two things:
* It adds more keysyms preferably taken from XLookupKeysym than XLookupString (namely, all numpad ones).
* It falls back to keysyms from XLookupKeysym in other cases, when XLookupString does not produce anything we know of.

Finding the correct balance here is far from easy, but think we are comming rather close to it now...
2016-09-10 12:38:12 +02:00
Bastien Montagne
d0e7c7a032 Add XK_ISO_Left_Tab to ghost's known X11 keydefines... 2016-09-06 22:32:17 +02:00
Bastien Montagne
f298c9ea1a Cleanup previous commit... 2016-09-06 18:01:14 +02:00
Bastien Montagne
87b3faf557 GHOST X11 keyboard: Attempt to fix issues with modifier keys on some systems.
Could not reproduce it here, but since users having the issue claims it comes from
rB16cb9391634dcc50e, let's try to use again ugly `XLookupKeysym()` for those modifier keys too...
2016-09-06 17:54:40 +02:00
Bastien Montagne
16cb939163 Fix T48911: Fix T48847: Issues with some shortcuts on non-US latin keyboards, and with non-first layouts.
This is a tentative fix, own tests here seem to be working OK,
but don't think it's safe enough to be backported to 2.78.
2016-09-03 17:50:56 +02:00
lazydodo
f0159d1d48 Fix T49215 2016-09-01 14:00:20 -06:00
Mike Erwin
28cf9cfd15 NDOF: fix crash on Mac with old drivers
For best results use the latest 3Dconnexion driver. But latest is only
supported on Mac OS 10.9+. We go all the way back to Mac OS 10.6 so
have to deal with older driver versions.

See the original dlclose line for my faulty assumption. Waiting to
unload the driver later fixes the crash. Newer drivers don’t seem to
have this issue.

Also removed WITH_INPUT_NDOF guards as NDOFManager.h takes care of
this. Follow-up to b10d005 a few days ago.
2016-08-21 23:09:30 -04:00
Mike Erwin
b10d0058d7 NDOF: compile 3D mouse code only if WITH_INPUT_NDOF
When WITH_INPUT_NDOF is disabled, 3D mouse handling code is removed
from:

- GHOST (was mostly done, finished the job)
- window manager
- various editors
- RNA
- keymaps

The input tab of user prefs does not show 3D mouse settings. Key map
editor does not show NDOF mappings.

DNA does not change.

On my Mac the compiled binary is 42KB smaller after this change. It
runs fine WITH_INPUT_NDOF on or off.
2016-08-18 00:22:18 -04:00
Mike Erwin
a195dd15d4 NDOF: suppress buttons debug log
Accidentally left this in the 3D mouse code. Mac only.
2016-08-18 00:22:18 -04:00