aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native
Commit message (Collapse)AuthorAgeFilesLines
* Bug 924: Make ALWAYS_ON_TOP Persistent when Reparenting (child -> top) (2nd ↵Sven Gothel2013-12-201-4/+0
| | | | | | | | | | | | attempt) Commit c8726ef04b94ad8e66e1191a06ff793b908d130c reinforced ALWAYS_ON_TOP in native reconfig code issued at reparenting call, which might be too early for the WM. Perform ALWAYS_ON_TOP reinforcement from java side when reparenting CHILD -> TOP was successful and visibility is reached. X11 only! NewtAWTReparentingKeyAdapter: Add 'a' alwaysOnTop toggle to test w/o applet code.
* Refine commit c9fcc8cd510abc0cbebb872dc3e457327655e778 (NEWT X11Window.c ↵Sven Gothel2013-12-201-8/+8
| | | | comments)
* Bug 924: Fix X11 Fullscreen ALT-TAB Regression ; Make ALWAYS_ON_TOP ↵Sven Gothel2013-12-191-1/+14
| | | | | | | | | | | | | | | | | | Persistent when Reparenting (child -> top) - X11 Fullscreen ALT-TAB regression (no task-switcher visible) We still need the fast reconfigure path for ALWAYSONTOP only toggle. It was removed w/ commit c9fcc8cd510abc0cbebb872dc3e457327655e778, which disabled toggling FULLSCREEN and ALWAYSONTOP. Note: Another bug in Unity WM's Compiz: 'Unredirect Fullscreen Windows := True' disables the ALT-TAB taskbar/launcher HUD rendering and subsequent task-switch. Hence it shall be disabled .. nothing we can do here. - ALWAYS_ON_TOP not persistent when child -> top WM removes ALWAYS_ON_TOP state when reparenting, hence reinforce it when Child -> Top.
* Bug 924: Fix 'Unity WM' issue w/ sticky _NET_WM_STATE after Fullscreen ↵Sven Gothel2013-12-191-4/+12
| | | | | | | | | On/Off Cycle Unity WM keeps the _NET_WM_STATE (_NET_WM_STATE_FULLSCREEN, ..) after fullscreen-exit even though _NET_WM_STATE_REMOVE was issued. Add remedy: Reparent Child -> TOP: Reset _NET_WM_STATE (! _NET_WM_STATE_FULLSCREEN, ..).
* NEWT X11Window.c: Cleanup Code - No changes.Sven Gothel2013-12-191-8/+25
|
* Bug 919 - TestNewtKeyCodesAWT w/ NewtCanvasAWT Fails on Windows Due to ↵Sven Gothel2013-12-041-2/+2
| | | | | | | | | | | | | | Clogged Key-Release Event by AWT Robot Impact: Only unit test code - TestNewtKeyCodesAWT: Fix Bug 919 - Move mouse bacl/forth while waiting for events .. - Use common wait for key timeout/polling using constants in NEWTKeyUtil - InputEventCountAdapter: 'getQueued()' -> 'copyQueue()' - ensuring queue is copied while instance is locked.
* Bug 914: Newt OSX: Reset NSApp's presentationOptions @ windowClose0() / ↵Sven Gothel2013-12-033-51/+67
| | | | | | | | | | | | | | | Assume having focus in fullscreen-mode - Reset NSApp's presentationOptions @ windowClose0() Commit 69c334448cfe8af553fd97689137ecf8f996b378 started using the [NSApp setPresentationOptions: opts] but missed to reset to defaults @ windowClose0(); - Assume having focus in fullscreen-mode NewtMacWindow::windowDidBecomeKey()' is not always called in fullscreen-mode! Note: OSX Fullscreen from a browser still shows the browser title-bar until mouse-click. Don't know how to avoid this. Minor issue..
* Bug 916 - NEWT Fullscreen Mode on Windows ALT-TAB doesn't allow Application ↵Sven Gothel2013-12-031-20/+58
| | | | | | | Switching Remedy for 'some' display drivers, i.e. Intel HD: Explicitly push fullscreen window to BOTTOM when inactive (ALT-TAB)
* NEWT Windows: Rearrange wndProc switch-case: All key/mouse events shall be ↵Sven Gothel2013-12-021-448/+449
| | | | at last
* Bug 914: Newt OSX: Don't use exclusive fullscreen mode (captured display) in ↵Sven Gothel2013-12-023-0/+37
| | | | favor of proper WM incl. ALT-TAB app-switching
* Nativewindow/NEWT: Fix C Return StatementSven Gothel2013-11-171-1/+2
|
* Bug 903 - NEWT: Support 'Continue Drag on Exit'; Consistent Mouse ENTER/EXITSven Gothel2013-11-172-45/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Support 'Continue Drag on Exit' - Track dragging operation, allow exterior dragging - Hence track EXIT (see below) - Windows: - Capture mouse for exterior dragging - Only 'NewtWindows_trackPointerLeave' if 'entering' - Simplify touch: No 'inside' check - Not required. - Consistent Mouse ENTER/EXIT - Track ENTER/EXIT and synthesize if required, drop duplicate - OSX benefits, since it never produced ENTER/EXIT events - AWT (or other TK) translated events beahve equal now. - Required for EXIT event after ending exterior dragging and final RELEASE Tests: Passed unit tests 'junit.run.newt.event' on - GNU/Linux - Windows7 - OSX 10.7 Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT: - GNU/Linux - Windows7 (mouse) - Windows8.1 (touch) - OSX 10.7
* Fix Bug 901 - NEWT: Lookup Windows 7 Touch Event Functions Dynamically to ↵Sven Gothel2013-11-101-5/+39
| | | | not break Windows < 7 Compatibility
* Bug 882 - Crash on OSX when closing NEWT window - Fix: Release NewtMacWindow ↵Sven Gothel2013-11-011-7/+21
| | | | | | | | | | manually in close0() Release NewtMacWindow manually in close0() - Mark [NewtMacWindow setReleasedWhenClosed: NO] in init0(..) - Release NewtMacWindow manually in close0(..) Check pointer args in close0(..)
* Bug 882 - Crash on OSX when closing NEWT window - Check JavaVM and JNIEnv ↵Sven Gothel2013-11-011-11/+43
| | | | handles before usage in NewtMacWindow (Not the culprit .. but more safe)
* Bug 800: Windows 7 Touch Event Support for NEWT: Fix Focus and ↵Sven Gothel2013-10-171-51/+74
| | | | | | | | | | | | | LBUTTON[DOWN|UP] issues - w/ TOUCH, Win8 may steal focus (KILLFOCUS), quickly grab FOCUS again when on TOUCH operation - track 'touchDownLastUp', and don't act on LBUTTON[UP|DOWN] and MOUSEMOVE if just lifted last finger - don't use GetMessageExtraInfo() to distinguish MOUSE/TOUCH, simply use tracked touchDownCount - Also track mouseInside in TOUCH operation, i.e. true if _all_ fingers are inside, otherwise don't send TOUCH event
* Bug 800: Add Windows 7 Touch Event Support for NEWTSven Gothel2013-10-171-101/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native: - WindowUserData tracks: - window size - mouse inside - pointer touch-down count and flags whether multiple-touch is supported. - Suppress WM_*BUTTON* events if within TOUCH operations, e.g. fingers are pressed, or if event is determined as TOUCH (0 != GetMessageExtraInfo()) - MOUSEMOVE issues NewtWindows_trackPointerLeave(..) directly if no TOUCH operation is in process. Removes need for MouseListener on Java side. - TOUCH events are send as follows: - PRIMARY first - 1 MOVE 2nd (if not sent already) - UP/DOWN (if not sent already) We only send max. one MOVE event, since Win7 / Win8 assignes MOVE per default, even if no actual move happened. Hence a single MOVE event shall suffice and is compatible w/ e.g. Android (AFAIK). - TOUCH pointer names are mapped to consecutive IDs on the java side.
* NEWT Reparent/Fullscreen: Fixes X11 unsuccessful return to parent window; ↵Sven Gothel2013-10-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add reparentWindow(..) top-level position arguments; Misc - Fixes X11 unsuccessful return to parent window On X11 when returning to parent window (-> CHILD), we have to set the window invisible and wait for the result. Otherwise it sometimes happens that the WM's reparent operation fails, i.e. the window won't become a child of desired parent and is positioned randomly. - Add reparentWindow(..) top-level position arguments .. allows bringing the child-window to top-level w/ a desired position. Otherwise the window would be positioned elsewhere as a top-level as the plain reparenting operation. X11 needs to set position and size _after_ making the window visible, otherwise WM may ignore the XConfigureWindow request. - Reparent recreate shall always store the desired position and size On OSX/CALayer when recreation is being used, we need to store the pos/size for later creation. - Tests: Use 'NewtAWTReparentingKeyAdapter' where possible (reparent/fullscreen) instead of duplicating such code. NewtAWTReparentingKeyAdapter: Performs reparenting and fullscreen operations off-thread (i.e. not on AWT/NEW EDT) while decorating the action w/ revoking/restoring the ExclusiveContextThread (ECT). Manually tested 'TestGearsES2NewtCanvasAWT' reparenting and fullscreen on X11, Windows and OSX/CALayer w/ JDK 7u40 successful.
* NEWT/OSX (Bug 836): Lifecycle operations performed on main-thread must be ↵Sven Gothel2013-10-071-25/+34
| | | | | | | | | | | | | synchronized (wait-until-done) Wait-until-done (main thread): - WindowDriver.close0(..) - WindowDriver.initWindow0(..) Otherwise a re-queued operation (i.e. CALayer attachment) will mixup the order .. Experienced w/ fullscreen exit.
* X11Window FullScreen: Toggle _NET_WM_BYPASS_COMPOSITOR not only for ABOVE .. ↵Sven Gothel2013-07-041-2/+2
| | | | but also for FULLSCREEN WM state.
* Revise commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e (Bug 767): TAB, BS ↵Sven Gothel2013-07-031-1/+1
| | | | | | | | | and CR/ENTER are printable for NEWT KeyEvent and font handling. Fix regression. - Original behavior was treating CR/ENTER them as printable, lets keep it this way. - KeyEvent: Query these 3 whitespaces upfront, no need to incl. them in 'nonPrintableKeys'. - Fix regression: Native VK_ENTER was not change in commit 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e.
* Fix Bug 768 / NEWT Windows: Use layout dependent keySymbol, if independent ↵Sven Gothel2013-07-021-0/+3
| | | | keyCode is 0.
* Fix Bug 770 and 771Sven Gothel2013-07-021-98/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 770: X11Window.c: - Request focus _before_ enabling EWMH flags (fullscreen or above) after resize and temporary invisibility. This actually allows us to keep the focus after resize and repositioning! - Set _NET_WM_BYPASS_COMPOSITOR implicit analog to _NET_WM_STATE_FLAG_ABOVE - Clean up _NET_WM_* flag names, avoiding name space collisions, i.e. adding FLAG! - Remove dead _NET_WM_STATE setting via direct window property (not working anyways) - Remove dead code: FS_GRAB_KEYBOARD X11/WindowDriver.java: - Enable _NET_WM_STATE_FLAG_ABOVE temporarily if FLAG_IS_FULLSCREEN && !FLAG_IS_ALWAYSONTOP - Override focusChanged(..) to react on focus lost/gained in case of temporarily enabled _NET_WM_STATE_FLAG_ABOVE. If focus is lost, disable _NET_WM_STATE_FLAG_ABOVE, otherwise re-enable it. WindowImpl.java: - FullscreenAction.run: Always use 'FLAG_IS_FULLSCREEN_SPAN' +++ Bug 771: WindowImpl.java: - Keep fullscreenMonitors and fullscreenUseMainMonitor values intact, allowing them to be tracked. Remove duplicates in FullscreenAction class. - MonitorModeListenerImpl.monitorModeChanged: Add fullscreen path: If the changed monitor is part of fullscreenMonitors, recalculate the viewport union and reset position and fullscreen-size. - MonitorModeListenerImpl: Try to regain focus after successful mode change.
* NEWT Screen ..: Typos / JNI signatureSven Gothel2013-06-301-1/+1
|
* Fix Bug 688: Removal of NEWT KeyEvent.EVENT_KEY_TYPED and ↵Sven Gothel2013-06-174-14/+0
| | | | KeyListener.keyTyped(KeyEvent)
* Fix Bug 750: Leaked X11 ColorMap for each created X11 Window in NativeWindow ↵Sven Gothel2013-06-121-0/+7
| | | | | | | (dummy) and NEWT Free the colormap at WindowDestroy, which we have created at WindowCreate w/ AllocNone. Due to the fact we used 'AllocNone' the leak is minimal though ..
* Fix Bug 723: Remove VK_KP_<Cursor> numpad key-codes, use general VK_<Cursor> ↵Sven Gothel2013-05-163-33/+53
| | | | | | | | | | | | | | | | key-codes; Respect numpad printable keys; Use keySym for numpad if possible. - KeyEvent keyCode/keySym values re-ordered! - Remove VK_KP_<Cursor> numpad key-codes, use general VK_<Cursor> key-codes. Numpad cursor keys are not supported on some platforms (Windows), or not configured on most X11 configurations. - Respect numpad printable keys, i.e. don't treat them as non-printable. - Use keySym for numpad if possible. Numpad keys require modifiers, hence X11 and Windows shall return keySym.
* Fix Bug 600 and Bug 721: Adding support for multiple monitors w/ NEWTSven Gothel2013-05-0611-495/+773
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Support for all monitor devices and their available modes - X11: Use RandR 1.3 if available - Retrieve information - Changing a monitor device's mode - Support for dedicated and spannig fullscreen - See <http://jogamp.org/files/screenshots/newt-mmonitor/html/> - TODO: - X11 RandR does _not_ relayout the virtual screen size and neither the CRT's viewport. We may need to relayout them if they were covering a seamless region to achieve same experience! - OSX: No machine to attach a secondary CRT -> TEST! - Tested Manually for Regressions - Linux ARMv6hf (Rasp-Pi/BCM, Panda/X11) - Android (Huawei, Kindle) - Tested Manually and junit: - X11/Linux - NV, ATI-Catalyst w/ 2 CRTs - VBox w/ 4 CRTs - Win/Windows - NV, w/ 2 CRTs - VBox w/ 4 CRTs - X11/OpenIndiana, NV, 1 CRT
* Bug 721: NEWT/X11 RandR 1.3 Support - Part 2 - Rename impl class/files, ↵Sven Gothel2013-04-195-103/+90
| | | | start RandR13 coding.
* Bug 721: NEWT/X11 RandR 1.3 Support - Part 1 - Delegate RandR functionality ↵Sven Gothel2013-04-184-452/+219
| | | | to pluggable impl. for RandR 1.1 and 1.3 (todo)
* Bug 697: Fix commit 4db745e84fac610f85ab085e5c147e571e82e008 - Not compile ↵Sven Gothel2013-04-111-31/+36
| | | | | | | | | | | | | clean! Also brought back my safe showCursor logic. The code was not compile clean: - declaration after use w/o prototype! - missing var declaration 'success'! - 'pointerVisible=0', instead of 'wud->pointerVisible=0' var. not found! Used my old safe show cursor logic, while removing the max count, which was redundant, since we can check whether the counter moves in the right direction.
* NEWT/WindowsWindow.c: Simplify pointerVisible branch for calling ↵Sven Gothel2013-04-111-7/+2
| | | | SafeShowCursor(..)
* Merge remote-tracking branch 'gouessej/master'Sven Gothel2013-04-111-29/+53
|\
| * Adds the missing fileJulien Gouesse2013-04-061-29/+53
| |
* | NEWT KeyEvent: Use UTF-16 UniCode for key-code and key-symbol exposing well ↵Sven Gothel2013-04-112-188/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defined key encoding and simplify usage. Note, we use one collision to reduce key-code range: [0x61 .. 0x78] keyCodes [F1..F24] collide w/ ['a'..'x'] Since keyCode/Sym won't use lower capital a-z, this is a no isssue. KeyEvent: - 'printable' type is being determined by a nonPrintableKeys table, while 'action' type is set in case !printable and !modifier. - public ctor hidden, use create(..) method instead. This allows us to ensure modifier bit are properly set (incl. the keySym one) w/o performance loss. - ctor validates that only one of the type flags is set, printable, modifyable or action. WindowImpl: - Using IntBitfield of 255 bits to track pressed state, while removing the repeat state tracking since it is redundant. The Windows impl. uses a single field to validate whether a key was already repeated or not. - Properly cast keyCode short values to int for tracking! AWTNewtEventFactory, SWTNewtEventFactory: - Add translation of keyCode/Sym from and to NEWT - All tested via: - Newt -> Awt for AWTRobot - OSX CALayer: AWT -> NEWT - SWT tests X11: - Add VK_CONTEXT_MENU mapping (XK_Menu) LinuxEventDeviceTracker: - Fix apostrophe and grave mapping, i.e. to VK_QUOTE and VK_BACK_QUOTE. Adapted all unit tests, especially: - TestNewtKeyCodesAWT: More fine grained keyCode ranges to test using proper keyCode symbols.
* | Bug 641 NEWT/OSX Deliver keySym, derived from the current layout's ↵Sven Gothel2013-04-082-8/+72
| | | | | | | | lower-case UTF-16 character.
* | NEWT/OSX: Remove USE_SENDIO_DIRECT conditional compilation, by now it's ↵Sven Gothel2013-04-081-25/+2
| | | | | | | | clear we need to enqeue the events
* | Bug 641 NEWT/X11: Deliver 'J_VK_WINDOWS'; keySym is layout independent for ↵Sven Gothel2013-04-081-3/+16
| | | | | | | | dead-keys (zero keyChar); For 'unshifted' keySym's also unmask Ctrl and Mod* states
* | NEWT/Native: NewtCommon_GetJNIEnv(..) adding 'asDaemon' flag, used by all ↵Sven Gothel2013-04-083-30/+35
| | | | | | | | OSX JNI attachments to save time since detachment is skipped.
* | Bug 641 NEWT: X11 Deliver keyCode layout independent, keySym layout ↵Sven Gothel2013-04-082-19/+59
| | | | | | | | | | | | | | | | | | | | dependent and UTF-16 keyChar value On X11, the layout dependent keySym was not delivered [1], as well as the UTF-8 to UTF-16 translation was missing [2]. [1] is solved using XLookupString w/o ShiftMask [2] is solved using JNI's NewStringUTF, which takes UTF-8.
* | Bug 678: Differentiate ALT (left) and ALT_GRAPH (right) on X11, EventDev, ↵Sven Gothel2013-04-062-24/+44
|/ | | | | | | Windows and OSX - X11: Memorize pressed Alt_R to decide which 'alt' has to be used for non key modifier fetching - Windows: Only use GetKeyState(..) and compare the US vkey, since int. kbd layout use reduced scancode
* Bug 707: Fix NEWT EVENT_MOUSE_EXITED not sent on Windows - Regression of ↵Sven Gothel2013-04-051-5/+14
| | | | | | | commit 85338858f5c58694fa88e77df1386d0556887944 Commit replaced enqueueMouseEventID w/ sendMouseEventID, while not removing the 'jboolean wait' argument. This also lead to staying in DRAGGED mode when mouse left the window.
* OSX/NEWT: Fix native window parenting freeze, invisible/orderOut0, Position ↵Sven Gothel2013-03-201-40/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bugs w/ parenting Fix native window parenting freeze: - Pull out setJavaWindowObject(..) of changeContentView(..) to be called seperately, add param for changeContentView(..) to enable/disable setJavaWindowObject() - initWindow0(..): - Call changeContentView(..) w/o setJavaWindowObject() - setJavaWindowObject(..) at end of initialization Fix native window parenting orderOut0: If parent window is invisible or no parent used call orderOut(..), otherwise call orderBack(). Fix updatePosition(..): positionChanged(..) - Position bug w/ parenting - AWT parent passed 0/0 - call positionChanged(..) w/ client-pos instead of screen-pos Fix getLocationOnScreenImpl(..) - Position bug w/ parenting - Position < 0/0 is valid! Misc: - setWindowClientTopLeftPointAndSize0(..), setWindowClientTopLeftPoint0(..): Add 'display' param, deciding whether area should be display (invalidated)
* OSX/NEWT: NSWindow/NSView Ops on main-thread w/o blocking - Part2Sven Gothel2013-03-191-28/+39
| | | | | | | | | Continues commit 81cbcdc8469143587b2044661dd613c798ae02ba Perform on main-thread invocation from Java, allowing to issue visibleChanged(..) after creation/visible calls. This fixes the 'Visibility not reached ..' regressions.
* OSX/NEWT: Following CALayer streaming design, i.e. issue NSWindow/NSView Ops ↵Sven Gothel2013-03-193-156/+264
| | | | | | | | | | | | | | | | | | | | | on main-thread w/o blocking; NEWT/WindowImpl: Volatile multithreaded mutable values Similar to commits: 28c6472335b924080d638b33a28f8f4eedb459b1 f354fb204d8973453c538dda78a2c82c87be61dc main-thread operations cannot block main-thread. Luckily we are able to create the NSWindow and NSView instance uninitialized (deferred) on the current thread, while issuing their initialization on the main-thread w/o blocking. Further more a size glitch is fixed, which didn't take the title bar into account. +++ NEWT/WindowImpl: Volatile multithreaded mutable values Since position, size and other attributes might get changes off-thread, these fields needs to be volatile.
* NEWT/OSX: Fix 'locationOnScreen' usage and use proper client-area window ↵Sven Gothel2013-02-203-44/+56
| | | | | | screen position (Fixes resize -> position) - Tested w/ NEWT GearsES2 and Java6 and Java7 on OSX
* Bug 678 (fix), Bug 641 (API + Windows Impl.), Bug 688 (prep): Update NEWT's ↵Sven Gothel2013-02-196-573/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEvent handling while distinguish keyCode (kbd layout independent) and keySym (kbd layout dependent) API Changes: - Virtual key codes and symbols are of type short. - KeyEvent.keySymbol() shall return a layout dependent value (Bug 641) - Method returns former keyCode() value, which was layout dependent. - Returns 'short' value - KeyEvent.keyCode() returns a short value, instead of int - KeyEvent.keyCode() shall return a layout independent value (Bug 641) - To ease implementation, we only 'require' the scan code to be mapped to a 'US Keyboard layout', which allows reusing layout dependent code while preserving the goal to have a fixed physical key association - Implementation status: - Windows OK - X11 TODO - OSX: 50/50 TODO - Using layout independent 'action keys' - Using layout dependent 'printable keys' - returning above semantics for both, keyCode and keySym - Android 50/50 TODO - Returning the layout independent keyCode - Mapping probably incomplete - KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent) (Bug 688) - Marked DEPRECATED - No more called for auto-repeat events - Synthesized in WindowImpl.consumeKeyEvent(..): No more injection by native- or java driver code - NEWTEvent.eventType: int -> short - field, as well as all method involving eventType changed to short. - NEWTEvent.isSystemEvent: REMOVED - Never used as well as never being implemented properly Internal Changes: - Simplified keyEvent driver code - Especially the Windows native driver's mapping code could be simplified using scanCode and MapVirtualKeyEx - NEWT Event Factories: hashMap -> switch/case Unit Tests: - - Added NewtCanvasAWT Offscreen Layer Tests important to test the AWT -> NEWT translation on OSX/CALayer: - TestNewtKeyCodeModifiersAWT - TestNewtKeyCodesAWT - TestNewtKeyEventAutoRepeatAWT - TestNewtKeyEventOrderAWT - TestNewtKeyPressReleaseUnmaskRepeatAWT
* NEWT/OSX: Fix Memory Leak ; Fix Occasional Crash Duer to Lifecycle Ops not ↵Sven Gothel2013-02-172-27/+36
| | | | | | | | | | | | | | | | on Main-Thread. - Fix Memory Leak - NewtWindow::dealloc -> [NewtView release]: Fixes NewtView leak - NewtView::dealloc -> removeTrackingRect: Removes occasional crash (double free of TrackingRect) - Fix Occasional Crash Duer to Lifecycle Ops not on Main-Thread. Perform OSX WindowDriver ops on Main-Thread: - close0 - changeContentView0 - createWindow0 - Cleaned up AddRemove unit tests, added TestAddRemove03GLWindowNEWT
* Fix Bug 678: Deliver key-char value for printable chars on all ↵Sven Gothel2013-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEventListener (-> On Windows as well) The following is observed, where t0 and t1 refer to subsequent different timestamps: NEWT delivery order: PRESSED (t0), RELEASED (t1) and TYPED (t1) WINDOWS delivery order: PRESSED (t0), TYPED (t0) and RELEASED (t1) Windows Auto-Repeat: PRESSED (t0), TYPED (t0) Hence we changed the event reorder-code in NEWT to trigger NEWT-PRESSED on Windows-TYPED for printable chars, assuring key-char values on all listener callbacks. - KeyEvent.getKeyChar(): Removed disclaimer dedicated for Windows - Keyevent.isActionKey(): Completed for all NEWT non-printable action keys; Added static variant - Keyevent.isPrintableKey(): NEW: returns !isModifierKey(keyCode) && !isActionKey(keyCode) ; With static variant - Windows WindowDriver: - EVENT_KEY_PRESSED handles non-printable chars only - EVENT_KEY_TYPE handles printable chars only - Native: VK_DELETE passes keyCode - Unit tests: Wait for completion 1s -> 2s
* NEWT-MouseEvent getWheelRotation() API Update - Fixes Bug 659: NEWT ↵Sven Gothel2013-01-147-76/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Horizontal Scrolling Behavior (OSX, X11, Win32); Bug 639: High-Res Mouse-Wheel - API update 'float getWheelRotation()': Usually a wheel rotation of > 0.0f is up, and < 0.0f is down. Usually a wheel rotations is considered a vertical scroll. If isShiftDown(), a wheel rotations is considered a horizontal scroll, where shift-up = left = > 0.0f, and shift-down = right = < 0.0f. However, on some OS this might be flipped due to the OS default behavior. The latter is true for OS X 10.7 (Lion) for example. The events will be send usually in steps of one, ie. -1.0f and 1.0f. Higher values may result due to fast scrolling. Fractional values may result due to slow scrolling with high resolution devices. The button number refers to the wheel number. - Fix Bug 659: NEWT Horizontal Scrolling Behavior (OSX, X11, Win32) - See new API doc above - X11/Horiz: Keep using button1 and set SHIFT modifier - OSX/Horiz: - PAD: Use highes absolute scrolling value (Axis1/Axis2) and set SHIFT modifier for horizontal scrolling (Axis2) - XXX: Use deltaX for horizontal scrolling, detected by SHIFT modifier. (traditional) - Windows/Horiz: - Add WM_MOUSEHWHEEL support (-> set SHIFT modifier), but it's rarely impl. for trackpads! - Add exp. WM_HSCROLL, but it will only be delivered if windows has WS_HSCROLL, hence dead code! - Android: - Add ACTION_SCROLL (API Level 12), only used if layout is a scroll layout - Using GestureDetector to detect scroll even w/ pointerCount > 2, while: - skipping 1st scroll event (value too high) - skipping other events while in-scroll mode - waiting until all pointers were released before cont. normally - using View config's 1/touchSlope as scale factor - Fix Bug 639: High-Res Mouse-Wheel - getWheelRotation() return value changed: int -> float allowing fractions, see API doc changes above. - Fractions are currently supported natively (API) on - Windows - OSX - Android - AndroidNewtEventFactory ir refactored (requires an instance now) and AndroidNewtEventTranslator (event listener) is pulled our of Android WindowDriver.