Commit Graph

580 Commits

Author SHA1 Message Date
Matthias Clasen
4923da3550 Drop gtk_true and gtk_false
These functions are entirely trivial, their documentation
is much longer than their implementation, and it contains
an example that is annotated as "don't do this"...
2018-01-16 14:14:09 -05:00
Timm Bäder
abc0f67cf6 main: Set event user data earlier
event_widget is not modified anymore after the assignment from
handle_pointing event and we need the event's user data set for the
_gtk_window_check_handle_wm_event call.
2018-01-12 22:34:22 +01:00
Matthias Clasen
124a7969eb Drop another unused debug value
GTK_DEBUG_MULTIHEAD is unused as well.
2018-01-09 23:07:08 -05:00
Matthias Clasen
92e6557015 Remove an unused debug value
GTK_DEBUG_MISC is not used at all. Drop it.
2018-01-09 22:56:40 -05:00
Timm Bäder
3f68475b6f Make a few more code samples compile 2018-01-03 17:11:32 +01:00
Benjamin Otte
31119c89df gtk: Remove unused include 2017-12-15 23:53:18 +01:00
Benjamin Otte
a04afde35c gdk: Remove DRAG_STATUS and DROP_FINISHED events
Those are source-side events that are handled by signals of the
Dragontext these days.
2017-12-15 23:48:36 +01:00
Matthias Clasen
9194ee4973 gdk: Drop GDK_DAMAGE
We haven't been generating events of this type
since we dropped offscreen windows.
2017-12-14 23:35:08 -05:00
Matthias Clasen
65fc43a1f3 Drop GDK_CLIENT_EVENT
We never generate events of this type, so no need
to carry it around.
2017-12-14 22:55:03 -05:00
Matthias Clasen
0313b8f0bc gtk: Stop handling GdkEventWindowState
These events have been superseded by GdkWindow::state.
2017-12-14 22:24:06 -05:00
Benjamin Otte
f2bb2024c8 gdk: Remove properties
They are not used anymore.

Gone with them are PropertyNotify events.
2017-12-14 03:05:34 +01:00
Carlos Garnacho
332b640cd3 gtk: Make gtk_get_current_event() return a reference
All callers in gtk seem to be ok with it, and it makes sense if
we are dealing with events as "static after delivered".
2017-12-14 01:05:48 +01:00
Carlos Garnacho
d491e49fd6 gtk: s/gdk_event_free/g_object_unref/ 2017-12-14 01:05:48 +01:00
Carlos Garnacho
64decbfd74 gdk: Remove GdkEventType argument from GdkEvent union
It won't stand true anymore that the GdkEventType argument is the
first field of the GdkEvent* structs. All callers have been updated
to use event->any.type instead.
2017-12-14 00:58:32 +01:00
Benjamin Otte
54f9aef0d4 gdk: Remove gdk_selection_convert()
It's not used anymore.
2017-12-14 00:44:26 +01:00
Benjamin Otte
4042d5f242 gdk: Remove ability to own a selection
With this, the GDK_EVENT_SELECTION_REQUEST and GDK_EVENT_SELECTION_CLEAR
and the associated GtkWidget signals are gone, too.
2017-12-13 23:39:02 +01:00
Matthias Clasen
6cfb55a396 dnd: Remove much of the unmanaged dnd 2017-12-03 06:17:42 +01:00
Benjamin Otte
437d70f569 gdk: Get rid of owner change events
They're unused now.
2017-12-03 05:46:49 +01:00
Benjamin Otte
2d5c82b4ec gtk: Remove GtkClipboard 2017-12-03 05:46:49 +01:00
Benjamin Otte
0ff3340da7 main: Implement storing all clipboards 2017-12-03 05:46:48 +01:00
Benjamin Otte
4cce109e16 application: Put shared code into a common function 2017-12-03 05:46:48 +01:00
Benjamin Otte
0019178014 main: Don't gdk_flush() after every main loop wait
For a start, this makes gtk_main() work different from g_main_loop_run()
calls.

But most importantly, modern GDK does proper syncing itself and doesn't
need to rely on a catch-all to get it right.
2017-11-17 08:07:10 +01:00
Benjamin Otte
cf2d549e92 widget: Implement gtk_widget_pick()
... and use it.
2017-11-05 05:13:17 +01:00
Benjamin Otte
bd6b6ed93c gdk: Remove VisibilityNotify events 2017-11-01 22:00:34 +01:00
Benjamin Otte
2d31a5499a gdk: Remove gdk_get_display_arg_name()
Since we're no longer allowing arguments, this is always NULL now.
2017-11-01 18:26:34 +01:00
Matthias Clasen
2926669a9b gtk: Stop handling settings events
We don't need this anymore, now that we use the ::setting-changed
signal.
2017-10-30 09:48:51 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Carlos Garnacho
e0a3c9d2de gtkmain: Ensure to emit real GDK_LEAVE_NOTIFY events.
If we got a GDK_LEAVE_NOTIFY event from GDK, we would reset the
GtkPointerFocus, but the event would be silently consumed.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
a9988e18b0 gtk: Remove 2BUTTON and 3BUTTON events and event types
Those should be interpreted by widget-local gestures, not guessed at a
high level with no notions of the specific context. Users will want
GtkGestureMultiPress to replace these events.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
f2ded6a685 gtk: Change gtk_propagate_event() to propagate both ways.
This change is made for consistency, it doesn't make sense to expose
one-way propagation, as it can only break expectations from GTK+. This
function might be made entirely private in the future, but it still
makes sense to do this in one go for our internal usecases.
2017-09-19 18:39:03 +02:00
Matthias Clasen
c68c754f3e settings: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Timm Bäder
e2e91bf9bc Fix a few documentation issues 2017-07-19 21:27:15 -04:00
Timm Bäder
51e25aaff4 main: Protect against non-GtkWindow toplevels 2017-07-19 21:27:14 -04:00
Rico Tzschichholz
a4e80efee7 gdk/gtk: Fix Since tags for 3.92 symbols
In addition to 406db15066
2017-05-30 15:10:25 +02:00
Carlos Garnacho
0d7fe2ec09 gtk: Check implicit grab status before sending crossing events
As we now refrain from sending the crossing events if there's an
implicit grab, those events must be sent on button release when
the implicit grab is broken.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
f5fde52d61 gtk: Refactor crossing event synthesization into a separate function
This is now called outside update_pointer_focus_state() with the events
that actually matter (i.e. pointer ones, so no sequence == NULL checks)
2017-05-25 16:25:59 +02:00
Carlos Garnacho
e892e20841 gtk: Rework pointer cursor selection
Check the grab widget (both explicit and implicit) and check for a cursor
from the target widget up to this grab widget. If the target widget is
outside the grab widget, only the grab wigdet's cursor will be checked.

This also means that we have to ensure the cursor is updated on button
releases, as an implicit grab being deactivated must trigger a cursor
lookup from the target widget.
2017-05-25 16:25:59 +02:00
Timm Bäder
8371b6b857 main: Automatically (un)set PRELIGHT state on widgets 2017-05-25 16:25:59 +02:00
Timm Bäder
34fdc51392 Constify GdkEvent parameters in gtk_get_event_widget and _event_target 2017-05-25 16:25:59 +02:00
Timm Bäder
a0016758a8 widget: Copy event in gtk_widget_event and _captured_event
To ensure that we never translate the coordinates to widget coordinates
twice.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
33c5f3c193 gtkmain: Add API to get the target of a GdkEvent
This can be used on grabbing situations to determine the target of
the event. This mainly matters for GtkMenu.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
da56fae5df gtkmain: Ensure there is a current event handling crossing events
The "current event" will be the real one that is triggering the crossing
notifications, not the synthesized events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
03a63204c1 gtkmain: Ignore GDK_CROSSING_GRAB/UNGRAB crossing events for picking purposes
Especially with owner_events=TRUE, this doesn't mean anything for picking, as
events will be reported as usual inside the application.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
5483b9db2d gtkmain: Avoid doubly propagation of enter/leave events from windowing
Crossing events are already generated when picking the new pointer position,
so we don't have to propagate the windowing crossing event as-is.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
fa04bf6238 gtkmain: Use window-internal API to update pointer cursors 2017-05-25 16:25:59 +02:00
Carlos Garnacho
3dfab962fa gtk: Implement per-focus implicit grabs
Unlike GTK+ grabs which are global to all/one device, the implicit grab
is per focus, which means each may have implicit grabs on different or
the same widget.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
79e267a330 gtk: Implement cursor updates
As we don't obey GdkWindow cursors anymore, someone must set those.
Use the private Gtkwidget API at the moment.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
e25fcf983a gtk: Handle events with coordinates in toplevel-relative ones
Implement target finding per-pointer/touchpoint through GtkPointerFocus and
_gtk_toplevel_pick(). Focus changes are handled through the emission of
crossing events between the old target and the new one.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
53c297436d gtk: Add private _gtk_toplevel_pick() method
This function returns both the widget at the given toplevel coordinates,
and the translated x/y in widget relative coordinates.
2017-05-25 16:25:58 +02:00
Timm Bäder
6b12e3948e gtkmain: Fix code example
gtk_init doesn't take parameters anymore
2017-04-25 20:30:37 +02:00