Commit graph

173 commits

Author SHA1 Message Date
thefiddler 00b531fdef Fixed compilation warnings on Mono 3.4.0 2014-07-21 17:46:39 +02:00
thefiddler 461fbce45f Cleaned up a number of obsolete warnings 2014-07-21 16:39:58 +02:00
thefiddler ead151ea4f Fixed a large number of warnings 2014-07-21 16:03:37 +02:00
Stefanos A. d75a2ce439 [X11] Fix for issue #143
OpenTK will now use the same GLXFBConfig to create the INativeWindow
and IGraphicsContext on Linux/X11. This resolves an issue where OpenGL
3.x contexts could not be created on some graphics drivers (e.g.
nvidia binary.)
2014-07-19 20:39:17 +02:00
thefiddler a13a2f8e66 [X11] Workaround for issue #146
Windows are now unmapped before being destroyed.
2014-07-18 17:16:27 +02:00
thefiddler 786273dd19 [X11] Fixed OnMouseMove being called without mouse movement 2014-07-18 17:02:47 +02:00
thefiddler 7accefea3e [X11] Remove unused XCreateWindow overloads 2014-06-17 08:51:00 +02:00
thefiddler ec31675fc8 [X11] Fixed BadWindow error on shutdown
This was caused by calling XDestroyWindow inside Dispose(), or
by processing events after calling XDestroyWindow. Pending events
are now discarded when Close() is called and not cancelled, and
XDestroyWindow is only called if the window exists.
2014-05-19 22:02:46 +02:00
thefiddler ade8e61625 Merge branch 'xkeyfix' of https://github.com/thefiddler/opentk into develop 2014-05-19 10:52:37 +02:00
thefiddler cfb2d45b8b [X11] Improved WindowBorder.Fixed detection
This now works even without having to map the window first.
2014-05-19 09:22:27 +02:00
thefiddler 4ede3ad2d0 [X11] Renamed XI2Mouse
This file now implements both mouse and keyboard input, so its name
has been updated to reflect that.
2014-05-15 10:24:03 +02:00
thefiddler 7cce215a4b [X11] Use XKB for layout-independent input
The code will fall back to core X11 if XKB is not available.
2014-05-15 01:13:12 +02:00
thefiddler 1690cf859e [X11] Removed unused SetCursor() function 2014-05-14 00:42:05 +02:00
thefiddler c6dafbccba [X11] Implemented high-resolution scroll events 2014-05-13 23:23:51 +02:00
thefiddler a30af547f9 [X11] Improved CursorVisible = false behavior
We now use an XGrabPointer to confine the cursor to the window,
instead of the XWarpPointer hack. Fixes issue #28 and #36.
2014-05-13 22:31:45 +02:00
thefiddler 7e3b99c636 [X11] Fixed cursor position when CursorVisible becomes true 2014-05-13 13:23:20 +02:00
thefiddler fc718026fd [X11] Fixed Cursor when CursorVisible = false
Setting Cursor will no longer override CursorVisible.
2014-05-13 09:27:21 +02:00
thefiddler d7e0373852 [Platform] Fixed keys getting stuck on focus loss
NativeWindowBase will now clear all keyboard keys when losing focus.
This prevents keys from getting stuck when refocusing the window.

[Win] Also fixed WindowState.Maximized when WindowBorder is Hidden and
the window is minimized.
2014-05-09 16:45:45 +02:00
thefiddler f0d0f6e53a [X11] Fixed WindowBorder and WindowState setters
After many hours of fighting with xlib, the monster is slain and
WindowBorder/WindowState changes now take effect without messing
up the window size or position on the desktop.

Phew!
2014-05-09 13:10:23 +02:00
thefiddler 86146f54d5 [X11] Fixed key repeat 2014-05-09 00:26:51 +02:00
thefiddler d430b462fe [X11] Corrected size events 2014-05-08 20:58:11 +02:00
thefiddler 8b7d5bc7e4 [Input] Implement key repeat 2014-05-05 00:43:45 +02:00
thefiddler d968281a1b [OpenTK] Refactor keyboard and mouse handling
A lot of duplicated code is now moved to NativeWindowBase and
LegacyInputDriver.
2014-05-04 17:05:08 +02:00
thefiddler ff46455e56 [X11] Removed legacy X11Input driver
Its functionality has been moved directly into X11GLNative and
X11KeyMap.
2014-05-04 08:32:08 +02:00
thefiddler 3e33ac9280 [Platform] Refactored INativeWindow backends
All INativeWindow implementations are now derived from
NativeWindowBase. They no longer implement legacy IInputDriver
themselves, but rather rely on LegacyInputDriver provided by
NativeWindowBase for compatibility. They also implement the new Mouse*
events.
2014-05-02 16:52:11 +02:00
thefiddler 612652910f [Platform] Inherit NativeWindowBase 2014-05-02 14:18:40 +02:00
thefiddler c8c0d32fcc [OpenTK] Rearranged MouseCursor parameters
MouseCursor and WindowIcon now match GL.TexImage2D in the way they
arrange their parameters. The expected values of each parameter are now
documented.
2014-04-30 20:04:31 +02:00
thefiddler 890805f2ae [Platform] Renamed MouseCursor.Rgba to Argb
This matches the default format of System.Drawing.Bitmap.
2014-04-30 08:38:57 +02:00
thefiddler 96b7419d83 [X11] Fixed INativeWindow.Cursor getter 2014-04-27 22:28:10 +02:00
Fraser Waters 2207144aec Fix a bug in X11 CursorVisble with custom cursors.
CursorVisible reset to the default cursor when showing the cursor, it
should instead show the custom cursor if it's defined (else the default
cursor).
2014-04-27 10:53:34 +02:00
Fraser Waters 9239fd08e3 Custom cursors on X11. 2014-04-27 10:53:33 +02:00
thefiddler dd55cea489 [All] Initial implementation of INativeWindow.Cursor property
Affects issue #9
2014-04-27 10:52:53 +02:00
thefiddler a79086bb20 [X11] Set WM_CLASS property
This allows Ubuntu Unity and Gnome Shell to detect and display
the correct application name.
2014-04-26 20:27:00 +02:00
csantos c48f6399e4 Centering the cursor at (width/2, height/2), effectively fixing
the issue described in https://github.com/mono/MonoGame/issues/2283
2014-03-18 01:44:52 -03:00
thefiddler 2f4161108d [X11] Fixed KeyUp event arguments
KeyUp event was incorrectly fired with KeyDownEventArgs instead of KeyUpEventArgs. This is now fixed.
2014-02-25 01:13:46 +01:00
thefiddler ee1fb2a917 [X11] Implemented modifier keys 2014-02-25 01:13:46 +01:00
thefiddler 88f7cd68f5 [X11] Fixed border size on Gnome 3
The _NET_FRAME_EXTENTS atom is implemented differently by
different window managers, when window decorations are hidden
with Motif. Unity returns a 0 size, while Gnome 3 returns the
previous size.

This patch removes that ambiguity: when decorations are hidden,
border size becomes zero. This should work everywhere, unless
some window manager decides to troll us by decorating the window
when we explicitly request no decorations. Sigh...
2013-12-27 13:31:51 +02:00
thefiddler 6c6e09aae6 [X11] Allow resizing with fixed borders
Windows can now be resized programmatically, even when they have
WindowBorder.Fixed. All resizing logic is now consolidated in the
Bounds property, and ConfigureNotify messages are now handled
correctly depending on their source (StructureNotify or
SubStructureNotify.)
2013-12-27 11:07:38 +01:00
thefiddler 4d27b6ee55 Implemented X11 KeyDown/KeyUp events and reduced code duplication 2013-12-25 11:46:02 +01:00
thefiddler ffdf881cea Do not raise KeyPress for control characters 2013-12-25 11:14:30 +01:00
Stefanos A b08e59e861 Allow non-realized GraphicsMode
It is now possible to pass a non-realized GraphicsMode to the X11GLContext and X11GLNative constructors. A non-realized GraphicsMode is a GraphicsMode with a null Index (i.e. which has not passed through SelectGraphicsMode()).
2013-11-09 18:55:17 +01:00
Stefanos A. b57e58dc47 Implemented Sdl2GLControl
SDL2 still fails with "not an OpenGL window".
2013-09-30 20:47:29 +02:00
Dean Ellis 9a39949249 Merge pull request #1 from elisee/fix-client-rectangle-setter
Fix ClientRectangle setter on Windows (WinGL) & Linux (X11)
2013-03-22 16:29:36 -05:00
the_fiddler 4fde3c4dab Added conditional compilation and the necessary classes to compile OpenTK without referencing System.Drawing.dll. To build without System.Drawing, add "MINIMAL" to the conditional compilation symbols. Note that this is an experimental feature that will result in a source- and binary-incompatible dll. 2011-12-08 00:03:14 +00:00
the_fiddler 07cbb9dd8b * Input/Mouse.cs:
* Input/IMouseDriver2.cs:
* Platform/X11/X11Mouse.cs:
* Platform/X11/XI2Mouse.cs:
* Platform/X11/Functions.cs:
* Platform/Windows/WMInput.cs:
* Platform/X11/X11GLNative.cs:
* Platform/Windows/WinRawMouse.cs: Added ability to set the position
  of the mouse cursor.
[X11] Avoid grabbing the pointer, as this causes unexpected
  side-effects (XInput2 stops working, debugging becomes difficult).
  We now use XWarpPointer and try to discard the spurious MouseMove
  events it generates.
[X11] Make cursor visible when window loses focus, to make debugging
  easier. Restore previous state when it regains focus.
2010-11-23 17:17:13 +00:00
the_fiddler 529a376d77 * X11GLNative.cs: Added missing KeyDown/KeyUp events. 2010-11-09 11:52:14 +00:00
the_fiddler a070918e93 Removed events that are not part of the INativeWindow interface. 2010-10-28 09:34:13 +00:00
the_fiddler e13a8e25ae Added code to raise all available events. Removed unused events from old OpenTK versions. Fixed potential race condition when raising events (an event might become null between the null check and the actual raising). 2010-10-28 09:31:00 +00:00
the_fiddler 7c0dbf7dcf * Source/OpenTK/Platform/X11/X11GLNative.cs: Confine pointer to
window when it becomes invisible.
2010-10-20 09:50:49 +00:00
the_fiddler 3b72054480 * Source/OpenTK/Platform/X11/X11GLNative.cs: Refactored empty cursor
creation into its own function. Create one empty cursor for the
  lifetime of the window.
2010-10-20 09:19:34 +00:00