1
0
Fork 0
Commit graph

392 commits

Author SHA1 Message Date
Jussi Viiri 1a8484bc55 Add coordinates to drag events 2023-06-05 20:48:06 +03:00
Jussi Viiri 1c50c326cb Add drop data to all drag events
Add DragData::None instead of using Option<DragData>
2023-06-05 20:25:27 +03:00
Jussi Viiri b5f3939930 Parse drop data
Only handling files for now
2023-06-04 23:43:10 +03:00
Jussi Viiri ef64cae538 Delete some unused lines committed by accident 2023-06-04 21:40:45 +03:00
Jussi Viiri f5840bc65b Refactor away duplicated code 2023-06-04 21:39:59 +03:00
Jussi Viiri d8ffd4abc6 Drop effect is now set based on EventStatus 2023-06-03 22:50:39 +03:00
Jussi Viiri 0eff674319 Janky first version of drag and drop
Just recognized as a drop target
2023-05-31 22:43:30 +03:00
Micah Johnston c129b12ead
Merge pull request #139 from wtholliday/macos-clipboard
Macos clipboard
2023-02-23 12:09:17 -06:00
Taylor Holliday dbda356826 Use &str instead of String. 2023-02-22 10:14:54 -08:00
Taylor Holliday 2b70a08e14 Add stubs for copy_to_clipboard. 2023-02-21 17:09:17 -08:00
Taylor Holliday 9b1c3785c8 Linux build 2023-02-21 16:29:38 -08:00
Taylor Holliday 775d15df38 Simplify and use copy_to_clipboard. 2023-02-21 15:45:11 -08:00
Taylor Holliday 0675273801 Formatting 2023-02-21 15:26:22 -08:00
Taylor Holliday ffdc278e97 Add copy_to_clipboard. 2023-02-21 15:22:52 -08:00
Micah Johnston 7001c2521f
Merge pull request #136 from robbert-vdh/feature/resize
Support resizing windows after creation
2023-01-01 17:18:12 -06:00
Robbert van der Helm 425ee7ac35 Add missing AdjustWindowRectEx() for resize 2023-01-02 00:09:25 +01:00
Robbert van der Helm be5238ec46 Replace Rcs by reference to entire WindowState
This removes the need to pass through individual Rcs at the cost of
adding more lifetime parameters to the internals of the shared `Window`
struct and requiring an `Option` for the handler.
2023-01-01 23:41:41 +01:00
Robbert van der Helm c10ca6b40f Clean up the Windows WindowState
This would leak before this change.
2023-01-01 23:05:34 +01:00
Robbert van der Helm 8e3e078220 Fix Clippy lints in macOS backend 2023-01-01 22:38:57 +01:00
Robbert van der Helm 39e97ab2be Fix Clippy lints in Windows backend 2023-01-01 22:38:49 +01:00
Robbert van der Helm 96c0401865 Replace AtomicBool with Cell<bool>
https://github.com/RustAudio/baseview/pull/136#discussion_r1059198419
2023-01-01 22:35:23 +01:00
Robbert van der Helm 512c3f2393 Set macOS window size using setContentSize
I somehow completely missed this the first five times I looked through
the docs.
2022-12-16 23:20:56 +01:00
Robbert van der Helm d7a8c52d23 Round size before resizing on macOS
Otherwise the top row of pixels may contain flickering artifacts.
2022-12-02 20:17:11 +01:00
Robbert van der Helm bc2b2bd458 Factor in decorations when resizing macOS window
Apparently macOS doesn't do this for you. If you don't do this then
parts of the bottom and right of the window will be cut off.
2022-12-02 20:17:11 +01:00
Robbert van der Helm c7b61fa39b Also resize the OpenGL view on macOS
This fixes resizing with OpenGL applications.
2022-12-02 20:17:11 +01:00
Robbert van der Helm e0c79c58fb Implement window resizing for macOS
Now this works on all baseview platforms.
2022-12-02 20:17:11 +01:00
Robbert van der Helm 80fb0a00b8 Only send resize event on macOS on actual change
To follow the same behavior as on Linux and Windows.
2022-12-02 20:17:11 +01:00
Robbert van der Helm 537c303ee5 Only send resize event on Windows on actual change
To be in line with the Linux implementation.
2022-12-02 20:17:11 +01:00
Robbert van der Helm 5a1bb0f4d8 Ensure WindowEvent::Resized fires for Linux resize 2022-12-02 20:17:11 +01:00
Robbert van der Helm 80b30ce617 Implement window resizing for Windows 2022-12-02 20:17:11 +01:00
Robbert van der Helm b8a5867436 Replace uses of Arc with Rc in Windows impl
Everything is single threaded so there's no need to use Arcs.
2022-11-30 20:03:12 +01:00
Robbert van der Helm c5867b6af6 Use interior mutability for Windows WindowState
This is a prerequisite for being able to handle reentrant messages.
2022-11-30 20:03:12 +01:00
Robbert van der Helm 3dfff613b9 Use physical sizes in X11 window resize
And update the window info for any future events.
2022-11-30 20:03:12 +01:00
Robbert van der Helm d61f21666c Add window resizing for X11 2022-11-30 20:03:12 +01:00
william light ee156fb884
Merge pull request #133 from robbert-vdh/feature/horizontal-scrolling
Support horizontal scrolling on Linux and Windows
2022-11-22 15:55:04 +01:00
Robbert van der Helm f2ca0ffa6d Support horizontal scrolling on Windows 2022-11-22 15:42:10 +01:00
Robbert van der Helm 9798d3ca86 Support horizontal scrolling on X11
This was previously bound to the mouse forwards/back
buttons (canonically mouse 4 and 5).
2022-11-22 15:39:49 +01:00
Robbert van der Helm 025f34b80f Map mouse forward and back correctly on X11
Buttons 6 and 7 are for horizontal scrolling, just like buttons 4 and 5
are for vertical scrolling. I couldn't find a list of button numbers in
the X11 protocol specs, but this is what the buttons are bound to on my
Logitech G502 and
http://xahlee.info/linux/linux_x11_mouse_button_number.html also
confirms this.
2022-11-22 15:32:43 +01:00
william light 84f10763a3
Merge pull request #132 from robbert-vdh/fix/x11-frame-pacing
Ensure a consistent frame pacing in X11 windows
2022-11-18 18:06:11 +01:00
Robbert van der Helm 13cc12d4e7 Ensure a consistent frame pacing in X11 windows
The next frame's time stamp needs to be computed based on the last
frame's, not based on the current time, unless the last frame took too
long to process.
2022-11-18 15:24:33 +01:00
William Light 1780c89baf macos/view: fix compilation 2022-11-13 02:22:53 +01:00
william light eeded04b3e
Merge pull request #110 from ingo-dsp/macos-scrollwheel
macOS: scroll event handling
2022-11-13 02:14:16 +01:00
william light eae4033e7d
Merge pull request #117 from robbert-vdh/feature/mouse-event-modifiers
Add the active keyboard modifiers to the mouse events
2022-09-22 16:36:24 +02:00
Ingo Budde 3dd255f238 Merge branch 'master' into macos-scrollwheel 2022-07-24 00:25:46 +02:00
Robbert van der Helm 5b57af2463 Add the active modifiers to the mouse event
This would solve the most important use case for #116. Only the Linux
version has been tested, but the Windows should work perfectly fine, and
I don't know anything about macOS programming but that version also
compiles so it should be fine.
2022-03-11 22:28:42 +01:00
Robbert van der Helm e46001a448 Remove unused mouse click event
Since this isn't emitted anywhere, this can only lead to confusion for
library consumers. They'd need to implement their own click detection
with the button up and button down events.
2022-03-11 22:28:42 +01:00
Micah Johnston b3712638ba
Merge pull request #115 from robbert-vdh/feature/merge-raw-gl-context
Merge raw-gl-context into baseview to allow OpenGL contexts to be created during window creation
2022-03-07 12:22:30 -06:00
Robbert van der Helm 85b6437de8 Swap out X11 error handling mutex for a RefCell 2022-03-07 18:53:07 +01:00
Robbert van der Helm 0aae938af0 Remove unnecessary unsafe blocks 2022-03-07 18:41:29 +01:00
Robbert van der Helm ef86e56ac7 Keep the first X11 error 2022-03-07 18:17:50 +01:00