Commit graph

484 commits

Author SHA1 Message Date
Saracen
c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Hugo Locurcio
d54b5da940
Tweak some help texts in the build system
This also removes `unix_global_settings_path` from SConstruct
since it is no longer used.
2018-06-07 21:40:54 +02:00
Rémi Verschelde
f392650be2 Improve return value of OS.execute in blocking/non-blocking variants
Initialized the PID to -2, which will be the value returns in blocking-
mode where the PID is not available. (-1 was already taken to signify an
execution failure).

OS::execute will now properly return a non-OK error code when it fails
to execute the target file.

The documentation was rewritten to be very clear about the differences
between blocking and non-blocking mode.

Fixes #19056.
2018-05-30 12:55:17 +02:00
Guilherme Felipe
c8e0ec0580 Change position of validation in set_custom_mouse_cursor 2018-05-28 09:36:30 -03:00
Max Hilbrunner
856d945248
Merge pull request #19210 from guilhermefelipecgs/fix_invalid_image
Add validation in set_custom_mouse_cursor
2018-05-28 12:52:10 +02:00
Guilherme Felipe
aad6bdad94 Add validation in set_custom_mouse_cursor
Check if the image is valid.
2018-05-27 20:55:05 -03:00
Guilherme Felipe
aa174d963d Fix memory leak in set_custom_mouse_cursor 2018-05-26 15:56:35 -03:00
Guilherme Felipe
8c17d8e6fe More fixes to set_borderless_window
[x11] Preserve window size when calling this method.
[osx] Make sure it don't make the window resizable if it's not needed.
[windows] clean up the code.
2018-05-23 17:42:31 -03:00
Max Hilbrunner
0980991e64
Merge pull request #19070 from guilhermefelipecgs/fix_19033
Fix mouse confined and set_borderless_window
2018-05-21 18:30:11 +02:00
Guilherme Felipe
9af14ac1db Fix #15678
Fix cursor not displaying arrow when transiting from mode captured to
visible.
2018-05-21 14:37:30 -03:00
Guilherme Felipe
28d24c4f66 Fix #19033
- Fix a bug when mouse is confined don't update the cursor shape.
- Don't let the mouse leave the window when resizing to a smaller
resolution when MOUSE_MODE_CONFINED.
- Fix set_borderless_window to preserve the actual video_mode.widht/height.
2018-05-20 20:53:04 -03:00
Guilherme Felipe
50a0220d2d Reset the cursor with Input.set_custom_mouse_cursor(null) 2018-05-10 20:02:12 -03:00
Guilherme Felipe
8ead09342d Add support for atlas texture on set_custom_mouse_cursor 2018-05-09 12:44:43 +00:00
Hein-Pieter van Braam
e668757aa9
Merge pull request #14622 from bruvzg/non-rectangular-windows
Experimental support for windows with per-pixel transparency.
2018-05-08 16:44:35 +02:00
Rémi Verschelde
7e39647623
Merge pull request #18665 from mhilbrunner/build-sdk
Windows detect.py: Detect missing WindowsSdkDir
2018-05-08 10:21:54 +02:00
Blazej Floch
c45f44d856 Local debugger fixes and extensions
- Adds q/quit option to console debugging
- Adds options (variable_prefix)
- Breaks into debugger with Ctrl-C in local debug mode (Unix/Windows)
- Added option to list all breakpoints
- Fixes add/remove breakpoint bug (invalid path parsing)
- Minor cleanup
2018-05-07 23:17:06 -04:00
Max Hilbrunner
a6b191e3e0
Windows detect.py: Detect missing WindowsSdkDir 2018-05-07 00:42:12 +02:00
Max Hilbrunner
a53b08861a
Merge pull request #18541 from profan/fix/win-sleep
Windows: ensure minimum possible timer resolution for sleep
2018-05-05 06:47:13 +02:00
Robin Hübner
8cb1ff9452 windows: ensure minimum possible timer resolution for sleep 2018-05-01 09:58:16 +02:00
Pedro J. Estébanez
de9d40a953 Implement universal translation of touch to mouse
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*)

The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers.

Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse.

*: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest.

On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction.

Plus: Improve/fix tracking of current mouse position.

** Summary of changes to settings: **

- `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse`
- New setting: `input/pointing_devices/emulate_mouse_from_touch`
2018-04-30 19:03:38 +02:00
Guilherme Felipe
62b835a2cd Fix custom cursor when it's hidden
[Linux] Ensures that the custom cursor will be used when changing to
MOUSE_MODE_VISIBLE. Fix #3086

[Windows] Fix cursor flickering when MOUSE_MODE_HIDDEN.

[Mac] Fix possible cursor flicker when MOUSE_MODE_HIDDEN.
2018-04-09 10:28:20 -03:00
bruvzg
ddae098dee
Experimental support for windows with per-pixel transparency (macOS, X11 and Windows). 2018-04-07 17:11:45 +03:00
Guilherme Felipe
dc57632d66 Remove size restriction for mouse cursor 2018-04-05 15:41:09 -03:00
bruvzg
e337eecd17
Fix MinGW cross-build 2018-03-15 17:29:55 +02:00
Bastiaan Olij
cc9e8aa732 Added missing import BoolVariable
Didn't like the missing BoolVariable :)
2018-03-15 22:35:44 +11:00
Gary Oberbrunner
d1318ee12c Enable SCons to autodetect Windows MSVC compiler
SCons has good compiler detection logic for MSVC compilers. Up to now,
Godot hasn't used it; it depends on passed-in OS environment vars from
a specific Visual Studio cmd.exe windows. This makes it harder to
build from a msys or cygwin shell.

This change allows SCons to autodetect Visual Studio unless it sees
VCINSTALLDIR in the os.environ. It also adds a 'msvc_version' arg for
manual specification of compiler version, and uses the existing 'bits'
arg to specify the target architecture. More detail could be added as
desired. It also adds 'use_mingw' to always use mingw, even if Visual
Studio is installed. That uses the existing mingw setup logic.

If people are used to building Godot in a Visual Studio cmd window,
this should not change the behavior in that case, since VCINSTALLDIR
will be set in those windows. (However, note that you could now unset
that var and build with any other MSVC version or target arch, even in
that window.)

I refactored much of platform/windows/detect.py during this, to
simplify and clarify the logic. I also cleaned up a bunch of env var
settings in windows/detect.py and SConstruct to use modern SCons
idioms and simplify things.

I suspect this will also enable using the Intel compiler on Windows,
though that hasn't been tested.
2018-03-13 09:51:05 -04:00
bruvzg
ad67911f1a
Explicitly set OpenGL profile to core (X11, Windows).
Enable GLES2 on Windows.
2018-03-06 15:53:30 +02:00
Marcelo Fernandez
d780d774aa Clean and expose get_audio/video_driver_* funcs on OS class 2018-03-04 14:18:05 -03:00
karroffel
eac4c984df add GLES 2 renderer for 2D
This commit adds a new rendering backend, GLES2, and adds a
project setting to enable it.

Currently this backend can only be used on the X11 platform,
but integrating into other platforms is planned.
2018-03-01 15:12:30 +01:00
Marcelo Fernandez
f8da9550f4 Fixed Windows ignoring minimized/maximized status set by user 2018-02-26 17:38:00 -03:00
Rémi Verschelde
23ebae01dc Refactor version macros and fix related bugs
The previous logic with VERSION_MKSTRING was a bit unwieldy, so there were
several places hardcoding their own variant of the version string, potentially
with bugs (e.g. forgetting the patch number when defined).

The new logic defines:

- VERSION_BRANCH, the main 'major.minor' version (e.g. 3.1)
- VERSION_NUMBER, which can be 'major.minor' or 'major.minor.patch',
  depending on whether the latter is defined (e.g. 3.1.4)
- VERSION_FULL_CONFIG, which contains the version status (e.g. stable)
  and the module-specific suffix (e.g. mono)
- VERSION_FULL_BUILD, same as above but with build/reference name
  (e.g. official, custom_build, mageia, etc.)
  Note: Slight change here, as the previous format had the build name
  *before* the module-specific suffix; now it's after
- VERSION_FULL_NAME, same as before, so VERSION_FULL_BUILD prefixed
  with "Godot v" for readability

Bugs fixed thanks to that:

- Export templates version matching now properly takes VERSION_PATCH
  into account by relying on VERSION_FULL_CONFIG.
- ClassDB hash no longer takes the build name into account, but limits
  itself to VERSION_FULL_CONFIG (build name is cosmetic, not relevant
  for the API hash).
- Docs XML no longer hardcode the VERSION_STATUS, this was annoying.
- Small cleanup in Windows .rc file thanks to new macros.
2018-02-23 20:15:29 +01:00
luz.paz
612ab4bbc6 Fix typos with codespell
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt`
Whitelist consists of:
```
ang
doubleclick
lod
nd
que
te
unselect
```
2018-02-21 19:46:06 +01:00
Fabio Alessandrelli
d29488ee9b Link bcrypt lib in window and UWP 2018-02-20 17:42:16 +01:00
Rémi Verschelde
3925e6a543
Merge pull request #16696 from BTaskaya/master
PEP3101 applied with changing old type string formatting as new ones
2018-02-19 20:38:37 +01:00
Rémi Verschelde
4fa8987494 Windows: Fix case of imm32 for case-sensitive MinGW build
Fixes #16713.
2018-02-15 09:06:02 +01:00
BTaskaya
78dba05fc0 PEP3101 applied with changing old type string formatting as new ones 2018-02-14 19:29:25 +03:00
Rémi Verschelde
e0f43e0678
Merge pull request #15564 from RandomShaper/adpod-topmost
Add new window setting: always on top
2018-02-14 16:43:40 +01:00
Rémi Verschelde
7d7f8d9e54
Merge pull request #15864 from GodotExplorer/pr-get_unique_id-desktop-impl
Implement more methods for OS on Desktop platforms
2018-02-14 16:11:53 +01:00
Marcelo Fernandez
ea1d726a46 Added OS::center_window to center the window precisely on desktop platforms 2018-02-12 15:45:41 -03:00
geequlim
3be04f73f5 Windows: implement OS.get_unique_id and OS.set_ime_position 2018-01-31 09:40:33 +08:00
Hein-Pieter van Braam
b4d369c887 Implement OS::get_processor_count() for Windows
Current this is hardcoded as '1' for any platform except Unix. The
little is_wow64() dance is required to get correct output on a 32bit
compiled godot running on 64bit Windows according to MSDN.

This code should be UWP safe but I have no way to test that so it's not
implemented for UWP yet.
2018-01-29 16:50:49 +01:00
Rémi Verschelde
f12e8568d4
Merge pull request #16081 from djgaspa/dll-directory
Fix remove_dll_directory crash when cookie is null
2018-01-27 23:32:05 +01:00
Hein-Pieter van Braam
c6d9a7665a Make separate debug symbols opt-in
This adds a separate_debug_symbols option to the x11, windows, and osx
targets. This will default to adding normal debugging symbols to the
artifacts and only splits them when separate_debug_symbols=yes on the
Scons command line.
2018-01-26 20:46:56 +01:00
djgaspa
18e66a28bc Fix remove_dll_directory crash when cookie is null 2018-01-26 12:30:02 +01:00
binbitten
017a8521c0 Fix horizontal scroll for windows platform 2018-01-20 21:15:58 +01:00
Juan Linietsky
554e95747c sorry, accidentally pressed delete before commiting. 2018-01-10 17:55:00 -03:00
Juan Linietsky
0f00384c93 Added middle button doubleclick, fixes #15567 2018-01-10 17:46:41 -03:00
Pedro J. Estébanez
ee2c31d306 Add new window setting: always on top
Implemented for Windows and Linux.
2018-01-05 21:31:04 +01:00
Rémi Verschelde
db49f35ab8 SCons: Fix usage of LD when we meant LINK
Also made LINK and CXXFLAGS configurable as command line options.
Note that LINK currently expects the *compiler* that will be used
for linking and will call its configured linker behind the scenes
(so g++, clang++, etc., not ld.gold). See #15364 for details.
2018-01-05 20:37:45 +01:00
Juan Linietsky
7332da31fc Forced set mouse global position always, hopefully will fix #15354, otherwise out of luck. 2018-01-05 14:33:13 -03:00