Commit Graph

107 Commits

Author SHA1 Message Date
Ioannis Tsakpinis 2df01dd762 Reset resizable state on destroy. Close #142 2016-12-08 21:50:34 +02:00
Ioannis Tsakpinis e4b098c5e2 Do not reset cursor clipping when releasing mouse grab in fullscreen mode. Fix #106
Also refactored and optimized cursor handling.
2015-02-09 17:08:38 +02:00
Ioannis Tsakpinis 70a8746f9a Fix window resizing when mouse is grabbed and optimize cursor clipping 2015-01-14 01:38:21 +02:00
Ioannis Tsakpinis 89b22fa151 Fix cursor stuttering/drifting with mouse grab and high keyboard repeat rates
In those situations we get multiple WM_MOUSEMOVE events per frame. The problem was that we moved the cursor back to the window center after every such event, right in the middle of the event loop. The fix was to only center the cursor once, after the event buffer has been drained.
2015-01-14 01:09:42 +02:00
Ioannis Tsakpinis 831ac15619 Reset mouse tracking state on window recreation 2015-01-07 20:23:22 +02:00
Ioannis Tsakpinis 42ccc83499 Create virtual key up events for all pressed keys when the display loses focus.
This is a workaround for missed key events and incorrect key state reporting. This is actually a cleaner solution to the previous workaround on Windows and works nicely on Linux too.
2014-10-01 21:04:50 +03:00
Ioannis Tsakpinis 4aac231951 Application menu: Disabled activation on ALT/F10 key press and enabled on mouse click. 2014-07-22 00:37:47 +03:00
Ioannis Tsakpinis 5cf86767bb Fixed WM_WINDOWPOSCHANGED coordinate bug. 2014-06-17 21:05:33 +03:00
Ioannis Tsakpinis 55bfecf514 Reverted resizable workaround. 2013-12-22 16:56:00 +02:00
Ioannis Tsakpinis 5747615c41 Another attempt at fixing the client area bug when toggling resizable. 2013-12-14 16:36:57 +02:00
Ioannis Tsakpinis 66c987f9c2 Fixed Rect/RECT conversion and added a workaround that resets the OpenGL client area when we toggle resizable after window creation. 2013-12-13 15:33:13 +02:00
kappaOne eb2e7176b8 Add new LWJGL API Display.getPixelScaleFactor() for use in high DPI
modes, like HiDPI retina mode on OS X.
2013-11-11 23:12:51 +00:00
Ioannis Tsakpinis 4d0aebb39d Make sure clearAWTFocus() runs in the EDT. 2013-11-07 17:04:04 +02:00
Ioannis Tsakpinis 59a9a970b9 Fixed grabFocus to work when a parented Display is first shown. 2013-10-30 16:26:53 +02:00
Ioannis Tsakpinis 4ff2240b57 Do not apply SW_RESTORE when the window receives focus. Fixes #53. 2013-10-30 15:32:02 +02:00
Ioannis Tsakpinis 7cb0207eef Fixed missing key up events when both shift keys are pressed at the same time. 2013-10-20 15:31:47 +03:00
Ioannis Tsakpinis aee9bc4f84 [Windows] Attempt to fix Display.setParent focus behavior in applets. 2013-04-25 18:39:56 +03:00
Ioannis Tsakpinis caf21d89dc [Windows] Restored grabFocus() on WM_MOUSEACTIVATE. 2013-04-24 11:45:01 +03:00
Ioannis Tsakpinis b66a3243a8 [Windows] Cleaner activation by relaying mouse presses to parent Canvas, similarly to the Linux implementation. 2013-04-24 03:24:16 +03:00
Ioannis Tsakpinis 7df84ba1a2 [Windows] Close any open AWT menus on WM_MOUSEACTIVATE. 2013-04-22 17:53:39 +03:00
Ioannis Tsakpinis 6fd210fdb3 [Windows] Wait for the big icon to update on setIcon. This normally happens asynchronously, but we block until it's done and only then return from setIcon. 2013-04-19 19:05:23 +03:00
Ioannis Tsakpinis 9a895b1dba Attempt to fix focus transfer issue between Display and AWT components in JDK 7:
- Instead of grabbing focus directly to our window, we call requestFocus on the Canvas component. This will clear focus from any other AWT component.
- When the parent Canvas gets focus, we detect it in update and that's when we grab focus to our window. We can't use a listener, setFocus must be called in our thread.
- Alt-tabbing out/in also works because focus goes to the Canvas. The above check will trigger again and our window will be refocused.
2013-04-18 17:02:48 +03:00
Ioannis Tsakpinis c0b19b7743 Another attempt to fix focus problems with Display.setParent on Windows:
- Reverted to WS_CHILD in window flags.
- Added WM_MOUSEACTIVATE handling: Focus the display + return MA_NOACTIVATE.
- Removed unnecessary appActivate calls in WM_ACTIVATE. We don't receive WM_ACTIVATE with WS_CHILD and the focus events do the job just fine.
- Detect parent window focus in update and force focus the display. This is useful when we alt-tab to the parent window and we don't receive any events.
2013-04-17 22:19:38 +03:00
Ioannis Tsakpinis 5400bb27db Misc fixes and improvements on Windows:
- Cleaned up cl flags and enabled parallel compilation. Native compilation
  is now multiple times faster.
- Fixed all /W3 compilation warnings.
- Changed window flag from WS_CHILDWINDOW to WS_POPUP when Display.setParent
  is used, in an attempt to fix focus-related issues.
2013-01-29 22:53:11 +02:00
Ioannis Tsakpinis 814f9a141e Attempt to fix lost key up events when Display is out of focus. (Windows) 2012-08-23 10:36:12 +00:00
Brian Matzon b4cc6176e7 fixed issue with win32 get x/y returning client-area coords 2012-07-14 23:29:21 +00:00
Brian Matzon 9ed2bd06aa applying white border fix from dr_evil 2012-03-19 22:12:38 +00:00
Brian Matzon 65fddce290 added win32 display get x/y 2012-02-18 18:38:57 +00:00
kappa1 e5ebf82c81 Added the new public API's Display.getX() and Display.getY(). Currently implemented for Linux and Mac. Windows implementation pending. 2012-02-18 16:30:38 +00:00
Brian Matzon d813fcfaa8 applied dr_evil's maximized patch 2012-02-06 20:35:25 +00:00
Brian Matzon c32fe94990 updated fix for resizable 2012-02-01 22:50:59 +00:00
Brian Matzon 00446046f0 applying suggested fix for resize issue 2012-02-01 21:33:45 +00:00
Brian Matzon 639d1d1457 support for 5 buttons on windows 2012-01-29 20:26:13 +00:00
Brian Matzon 367b5fb176 adding WS_MAXIMIZEBOX patch for windows and bumping native version 2012-01-11 20:46:57 +00:00
Brian Matzon 23adaeba93 Applying WM_SETCURSOR patch to fix issue with cursor 2012-01-02 22:06:12 +00:00
Brian Matzon b0dafc2a25 undoing commit of r3717 2012-01-02 22:03:53 +00:00
Brian Matzon dc8aabb8a6 Applied WM_SETCURSOR to fix issue with cursor 2012-01-02 21:59:20 +00:00
Ioannis Tsakpinis 41af142324 Added support for OpenGL 3.2 on MacOS X 10.7+. 2011-09-03 18:52:45 +00:00
Ioannis Tsakpinis 87c04cc995 Text encoding improvements. 2011-08-20 16:38:45 +00:00
Ioannis Tsakpinis 67945fe317 Added unicode support on Windows.
Fixed AL and GLES native stub bindings.
Replaced many GetStringNativeChars usages with a Java implementation.
2011-08-16 22:17:32 +00:00
Brian Matzon 087d0f4ba9 Initial stab at win32 resize api 2011-07-21 22:52:16 +00:00
kappa1 5949d57bb1 Implement Resizing Display API for OS X 2011-07-13 22:15:35 +00:00
kappa1 9aafabd728 Add placeholder methods for initial resizing api for the Display 2011-07-12 22:07:32 +00:00
Ioannis Tsakpinis 40cbf3e45f Added support for OpenGL ES. 2011-05-17 16:53:57 +00:00
Brian Matzon 91c32952b5 fixing icons as per dr_evil [http://lwjgl.org/forum/index.php/topic,3925.0.html] [proper] 2011-04-16 21:13:27 +00:00
Brian Matzon 07ffa133ad fixing icons as per dr_evil [http://lwjgl.org/forum/index.php/topic,3925.0.html] 2011-04-16 18:38:48 +00:00
kappa1 c69a165ad1 remove debug code left in WindowsDisplay, thx to MatthiasM. 2010-11-26 20:38:39 +00:00
Ioannis Tsakpinis a8bcb7fd25 Ported codebase to Java 1.5.
Misc OpenCL fixes and API improvements.
Changed fractal demo to use events/sync objects instead of cl/glFinish for synchronization. (untested)
2010-09-28 21:11:35 +00:00
Ioannis Tsakpinis 47c9991b41 Fixed ByteOrder of @Return ByteBuffers.
Cleaned up Drawable interface and introduced a reusable base implementation.
Added support for disabling runtime function checks, buffer checks and state tracking. Activated with -Dorg.lwjgl.util.NoChecks=true
2010-04-22 23:21:48 +00:00
Ioannis Tsakpinis b31603f219 Fix for grabbed mouse deltas. 2010-04-01 15:05:32 +00:00
Ioannis Tsakpinis 6998610cce Fixed mouse grabbing on secondary monitors.
Added extra device polling when vsync is enabled, to reduce input lag.
2010-03-31 23:56:24 +00:00
Brian Matzon 7bd6eb6d16 patch as per http://lwjgl.org/forum/index.php/topic,3124.0.html 2010-03-17 18:55:59 +00:00
Jeremy Booth cb925a91e9 Try and find a sensible video driver to report on rather than assuming it's video0. 2010-03-12 20:15:38 +00:00
Brian Matzon 663a7cf235 stop updating cursor all the time and only continue animation if mouse is inside window 2009-11-26 22:44:17 +00:00
kappa1 e9e9bf7b91 FIX: Mouse Grab should now work on Windows when using Display.setParent() 2009-11-12 22:12:49 +00:00
Brian Matzon 8bd591fe5e support for tracking mouse outside window on drag, new api for checking if mouse is inside window 2009-09-12 22:15:21 +00:00
Brian Matzon c7eabcad3e fixed windows click/movement detection if drag started inside display 2009-06-03 11:08:58 +00:00
Brian Matzon a6ae9f33b5 fix windows issue with mouse down true when released outside window 2009-05-26 20:39:23 +00:00
Elias Naur ed1f8d70f4 Removed redundant fullscreen argument from DisplayImplementation.createWindow 2008-10-28 10:05:37 +00:00
Elias Naur 41c90bc7cc Windows: Merged native handling of undecorated and fullscreen window property 2008-10-28 09:53:16 +00:00
Elias Naur d464876fe0 Windows: Only clip mouse to window borders if the lwjgl window is the foreground window 2008-10-27 14:04:12 +00:00
Ioannis Tsakpinis d7ee23f9b2 Added support for OpenGL 3.0 functionality
Added support for OpenGL 3.0 context creation (MAJOR/MINOR versions, DEBUG mode, FORWARD_COMBATIBLE mode)
Added support for OpenGL 3.0 context sharing
Added support for OpenGL 3.0 extension detection
Improved support for floating point PixelFormats (ARB_color_buffer_float)
Added support for packed floating point PixelFormats (EXT_packed_float)
Added support for sRGB PixelFormats (ARB_framebuffer_sRGB)
Added support for pseudo-FORWARD_COMBATIBLE mode (deprecated functions not loaded)
Added support for EXT_direct_state_access
2008-08-19 16:46:03 +00:00
Elias Naur 9293ee4073 Windows: Split WindowsDisplay.nDestroyWindow into nReleaseDC and nDestroyWindow 2008-05-05 17:24:42 +00:00
Elias Naur 5e06f19944 Windows: Generalized WindowsDispaly.nCreateWindow 2008-05-05 16:46:16 +00:00
Elias Naur b6b83936ac Windows: Clean up window in case of exception thrown from WindowsDisplay.createWindow 2008-05-02 11:05:49 +00:00
Elias Naur b11fcc99f6 Windows: Moved pixel format logic from WindowsDisplayPeerInfo.initDC to WindowsDisplay.createWindow 2008-05-01 09:55:54 +00:00
Elias Naur 0a3bf6e075 Windows: Moved icon handles to java 2008-05-01 09:20:57 +00:00
Elias Naur bcb909f5a9 Windows: Moved hwnd and hdc to java 2008-04-30 16:40:14 +00:00
Elias Naur 1006aed308 Windows: Made WindowsDisplayPeerInfo take hwnd and hdc arguments 2008-04-30 16:01:25 +00:00
Elias Naur 2420133bb9 Windows: Moved child window style selection to java 2008-04-30 15:29:39 +00:00
Elias Naur 657bd156e2 Windows: Removed directinput files, since they are now unused. Fixed headers build.xml target 2008-04-10 20:47:29 +00:00
Elias Naur 1a9bed90ed Windows: When parented, take focus on mouse click 2008-04-09 18:25:30 +00:00
Elias Naur e4d35cdb0d Windows: Use current Mouse.isGrabbed() when determining grab status 2008-04-08 11:21:57 +00:00
Brian Matzon bb16ec7492 updated and added license where needed 2008-04-07 18:36:09 +00:00
Elias Naur 97ebcea9c8 Windows: Improved focus handling when Display.getParent() != null 2008-04-07 15:33:34 +00:00
Elias Naur 3948769802 Windows: Implemented Display.setParent support 2008-04-07 10:18:09 +00:00
Elias Naur c499f33bcf Added experimental Display.setParent to allow Display to be embedded in an AWT Canvas. Added basic linux implementation and test. 2008-04-06 20:56:52 +00:00
Elias Naur bc33b3c4d5 Windows: Moved Display.setIcon logic to java 2008-04-01 20:45:24 +00:00
Elias Naur e448bb0c29 Removed OS message polls from mouse and keyboard poll() and read(), since they can be quite expensive 2008-01-19 08:49:10 +00:00
Elias Naur 4bf0703eb1 Windows: Pulled DefWindowProc calling to java side 2007-12-13 09:29:36 +00:00
Elias Naur 1c935179f3 Windows: Don't do SYSRQ hackery on WM_SYSKEYDOWN 2007-08-17 06:14:40 +00:00
Elias Naur c443696e24 Reverted 2877 2007-08-17 06:12:59 +00:00
Brian Matzon 26a040a7d2 handle alt+space (windows system menu) 2007-08-16 20:29:01 +00:00
Elias Naur 02d119d76e Windows: Handle WM_SYSCHAR 2007-08-16 09:46:45 +00:00
Elias Naur 9851b06009 Windows: Make cursor visible when grabbed and not focused 2007-08-16 08:38:20 +00:00
Elias Naur e76fd53950 Windows: Fixed cursor clipping when loosing focus 2007-08-12 23:33:25 +00:00
Elias Naur 7a49d5ce8f Windows: Mapped VK_SNAPSHOT to KEY_SYSRQ and added workaround to a windows bug where WM_KEYDOWN is never generated for VK_SNAPSHOT 2007-07-29 19:43:36 +00:00
Elias Naur 3f21f95b2f Windows: Don't be too aggressive in clipping the cursor. Fixes a problem where the window is moved out of the screen when clicking the title bar while having the mouse grabbed 2007-07-28 21:19:58 +00:00
Elias Naur 8bb3e5aec0 Windows: Removed an unused parameter from WindowsDisplay.clipCursor 2007-07-28 20:46:17 +00:00
Elias Naur 2d436e3231 Windows: Fix repeated character codes 2007-05-31 08:52:55 +00:00
Elias Naur fc759e6192 Implemented Keyboard.enableRepeatEvents(), Keyboard.areRepeatEventsEnabled() and Keyboard.isEventRepeat() to control repeat event reporting. Added repeat key test to KeyboardTest 2007-05-13 22:01:48 +00:00
Elias Naur 649822f65b Windows: Use TranslateMessage and WM_CHAR to receive character input instead of manual translation. This change fixes composed characters. 2007-04-24 14:41:17 +00:00
Elias Naur 010d6582c7 Windows: Call default handler on key events 2007-04-24 14:13:42 +00:00
Elias Naur 13cec51058 Windows: Convert WindowsKeyboard to use windows messages instead of DirectInput. 2007-04-24 13:40:13 +00:00
Elias Naur 23701fdf75 Windows: Remove dependency on DirectInput for WindowsMouse used by WindowsDisplay. Keyboard conversion coming up. Reasons:
1. DirectInput is deprecated (http://en.wikipedia.org/wiki/DirectInput). Specifically, Microsoft recommends using regular windows messages for keyboard and mouse input.
2. Not using DirectInput enable us to use the Raw Input JInput plugin to access multiple mice (and keyboards).
3. We're already using windows messages for features DirectInput never supported, so by removing DirectInput dependency, we get rid of some special case code.
4. When we're only using windows messages for input, we're (theoretically) more compatible than with a dependency on a properly working DirectInput.
2007-04-24 09:30:03 +00:00
Elias Naur 3899e6828f Windows: Correct testing of wParam when a WM_SYSCOMMAND is received 2007-03-30 19:35:37 +00:00
Elias Naur 56178d97fd Make the rest of LWJGL thread safe. No attempt have been done to make the locking minimal. Instead, one global lock is shared by Display, Mouse, Keyboard and Cursor. The lock surrounds all public methods. 2007-02-12 12:18:26 +00:00
Elias Naur 46ce5679c8 Windows AWTInput: Make sure the cursor is contained within the window when the Mouse is grabbed. 2007-01-30 13:08:51 +00:00
Elias Naur 97db4ca4b2 Windows: Don't use UpdateWindow after all. Instead, don't use a background brush at all to avoid windows clearing windows with non OpenGL drawing commands. Hopefully this will improve compatibility (The NeHe tutorials also don't specify a background brush). 2007-01-04 14:00:45 +00:00
Elias Naur 0234336feb Windows: Re-add UpdateWindow to make sure fullscreen windows are cleared faster 2007-01-04 13:44:23 +00:00