summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkeventsource.c
Commit message (Collapse)AuthorAgeFilesLines
* GdkSurface: Rename lots of stuff from window->surfaceAlexander Larsson2018-03-201-23/+23
| | | | | Mostly these are internal things, but the major public change is that event.window is now event.surface.
* GdkSurface: Rename various functions and variablesAlexander Larsson2018-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an automatic rename of various things related to the window->surface rename. Public symbols changed by this is: GDK_MODE_WINDOW gdk_device_get_window_at_position gdk_device_get_window_at_position_double gdk_device_get_last_event_window gdk_display_get_monitor_at_window gdk_drag_context_get_source_window gdk_drag_context_get_dest_window gdk_drag_context_get_drag_window gdk_draw_context_get_window gdk_drawing_context_get_window gdk_gl_context_get_window gdk_synthesize_window_state gdk_surface_get_window_type gdk_x11_display_set_window_scale gsk_renderer_new_for_window gsk_renderer_get_window gtk_text_view_buffer_to_window_coords gtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_tree_to_bin_window_coords The commands that generated this are: git sed -f g "GDK window" "GDK surface" git sed -f g window_impl surface_impl (cd gdk; git sed -f g impl_window impl_surface) git sed -f g WINDOW_IMPL SURFACE_IMPL git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface git sed -f g gsk_renderer_get_window gsk_renderer_get_surface git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface (cd gdk; git sed -f g window_type surface_type) git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type git sed -f g window_at_position surface_at_position git sed -f g event_window event_surface git sed -f g window_coord surface_coord git sed -f g window_state surface_state git sed -f g window_cursor surface_cursor git sed -f g window_scale surface_scale git sed -f g window_events surface_events git sed -f g monitor_at_window monitor_at_surface git sed -f g window_under_pointer surface_under_pointer (cd gdk; git sed -f g for_window for_surface) git sed -f g window_anchor surface_anchor git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL git sed -f g native_window native_surface git sed -f g source_window source_surface git sed -f g dest_window dest_surface git sed -f g drag_window drag_surface git sed -f g input_window input_surface git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
* GdkWindow -> GdkSurface: File renamesAlexander Larsson2018-03-201-1/+1
| | | | | | | | | | | | | Rename all *window.[ch] source files. This is an automatic operation, done by the following commands: for i in $(git ls-files gdk | grep window); do git mv $i $(echo $i | sed s/window/surface/); git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ; done git checkout NEWS* po-properties po
* GdkWindow -> GdkSurface initial type renameAlexander Larsson2018-03-201-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames the GdkWindow class and related classes (impl, backend subclasses) to surface. Additionally it renames related types: GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType, GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge This is an automatic conversion using the below commands: git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass git sed -f g GdkWindow GdkSurface git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2" git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE" git sed -f g "broadway_window" "broadway_surface" git sed -f g "BroadwayWindow" "BroadwaySurface" git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE" git sed -f g "wayland_window" "wayland_surface" git sed -f g "WaylandWindow" "WaylandSurface" git sed -f g "X11_WINDOW" "X11_SURFACE" git sed -f g "x11_window" "x11_surface" git sed -f g "X11Window" "X11Surface" git sed -f g "WIN32_WINDOW" "WIN32_SURFACE" git sed -f g "win32_window" "win32_surface" git sed -f g "Win32Window" "Win32Surface" git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE" git sed -f g "quartz_window" "quartz_surface" git sed -f g "QuartzWindow" "QuartzSurface" git checkout NEWS* po-properties
* x11: Run event filters on all windowsBenjamin Otte2018-02-131-4/+2
| | | | | | The event filters that were split out in commit 65beb0fc222662028b969085bb6e6cc30f263e10 need to be run for every event window and not just for the root window.
* Remove gdk_window_add_filterMatthias Clasen2018-02-071-59/+4
| | | | | | | | | | Drop the public filtering API. The x11 backend already has the ::xevent signal as replacement. The win32 backend needs a similar signal to replace filtering. Reshuffle header inclusions in the x11 backend a little bit to avoid a cyclic inclusion between gdkprivate-x11.h and gdkdisplay-x11.h that is otherwise causing problems.
* x11: Don't use gdk_window_add_filterMatthias Clasen2018-02-071-0/+14
| | | | This function is going away.
* Drop the Big GDK LockEmmanuele Bassi2018-02-031-12/+0
| | | | | | | | | | | | | | | | GDK has a lock to mark critical sections inside the backends. Additionally, code that would re-enter into the GTK main loop was supposed to hold the lock. Back in the Good Old Days™ this was guaranteed to kind of work only on the X11 backend, and would cause a neat explosion on any other GDK backend. During GTK+ 3.x we deprecated the API to enter and leave the critical sections, and now we can remove all the internal uses of the lock, since external API that uses GTK+ 4.x won't be able to hold the GDK lock. https://bugzilla.gnome.org/show_bug.cgi?id=793124
* gdk/x11: s/gdk_event_free/g_object_unref/Carlos Garnacho2017-12-141-5/+5
|
* gdk: Remove GdkEventType argument from GdkEvent unionCarlos Garnacho2017-12-141-7/+7
| | | | | | 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.
* gdk: Refurbish GdkEvent struct hierarchyCarlos Garnacho2017-12-141-9/+9
| | | | | Make all specific event structs contain a GdkEventAny, so the base struct can be extended without modifying structs all over the place.
* x11: Refactor xevent filtering some moreBenjamin Otte2017-12-131-16/+22
| | | | | | | | | | | We now have a GdkX11Display::xevent signal that gets emitted for every XEvent and allows you to interrupt processing via TRUE/FALSE return values. These return values to correspond to GDK_FILTER_REMOVE and GDK_FILTER_CONTINUE respectively. The GDK_FILTER_TRANSLATE case from gdk_window_add_filter() is now meant to be handled via gdk_display_put_event().
* x11: Add GdkX11Display:translate-event signalBenjamin Otte2017-12-131-33/+29
| | | | This is supposed to replace gdk_window_add_filter() in the long run.
* x11: Constify XEvent usageBenjamin Otte2017-12-131-5/+5
|
* gdk: Remove gdk_event_put(), peek() etcBenjamin Otte2017-12-131-2/+2
| | | | | We don't want to treat events like they don't belong to displays. So instead, people should use gdk_display_put/peek/get_event().
* x11: Stop using GdkScreen in apiMatthias Clasen2017-11-171-1/+1
| | | | | This type is going away, so switch to using GdkX11Screen everywhere.
* x11: Reduce uses of the root windowMatthias Clasen2017-11-091-0/+12
| | | | | | Avoid calling the get_root_window api that returns a GdkWindow in some places, and instead use the X root window directly.
* x11: Use backend-specific API to get GdkScreenEmmanuele Bassi2017-11-021-1/+1
| | | | | The gdk_display_get_default_screen() function was removed, but the X11 GdkEventSource still lobs around GdkX11Screen instances.
* Stop using foreign windows for xsettingsMatthias Clasen2017-11-011-1/+14
| | | | | | | Stop wrapping the xsettings manager window in a foreign window. This means that we cannot use the gdk window filter APIs anymore, so just do the filtering in a non-generic way.
* Drop gdk_window_get_screenMatthias Clasen2017-10-311-1/+1
| | | | | This includes removing the GdkScreen argument from the create_window_impl display vfunc.
* gdk/x11: Implement GDK_CROSSING_TOUCH_BEGIN/END/DEVICE_CHANGE eventsCarlos Garnacho2017-09-191-0/+106
| | | | | | The behavior where a touchpoint takes over the pointer position is really backend dependent. Since this went away from the generic code, implement it here.
* x11: drop a useless listMatthias Clasen2016-05-011-6/+0
| | | | | We were keeping all the event sources in a list, only to remove them at the end of their life. Not useful.
* x11: Avoid setting has_pointer_focus if a EWMH compliant WM is presentCarlos Garnacho2016-02-121-0/+5
| | | | | | | This is mostly useful to have focus behave sanely on lack of WM, so avoid any check there if we're positive there is a WM handling focus. https://bugzilla.gnome.org/show_bug.cgi?id=677329
* Handle recursion from motion event handlersOwen W. Taylor2013-11-111-2/+2
| | | | | | | | | | | | If a motion event handler (or other handler running from the flush-events phase of the frame clock) recursed the main loop then flushing wouldn't complete until after the recursed main loop returned, and various aspects of the state would get out of sync. To fix this, change flushing of the event queue to simply mark events as ready to flush, and let normal event delivery handle the rest. https://bugzilla.gnome.org/show_bug.cgi?id=705176
* gdk_display_get_event: don't unqueue events from the windowing system when ↵Owen W. Taylor2013-02-141-3/+9
| | | | | | | | | | | | paused Unqueuing events from the windowing system when paused could result in weird reordering if event filters resulted in application-visible behavior. Since we now resume events when the frame clock is frozen, we now no longer count on low-level event handling running while event handling is paused. https://bugzilla.gnome.org/show_bug.cgi?id=685460
* gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internallyMatthias Clasen2012-07-301-6/+6
| | | | | | These are just wrappers for the functions, and we want to deprecate them. Stopping to use them internally is a good first step.
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* configure: Check for XGetEventData()Carlos Garnacho2011-05-271-0/+6
| | | | | | This is a call only available in recent libX11, only the XI2 code depends on this within GDK, but XI2 implies having GenericEvents available too.
* gdk: Add _gdk_x11_event_translator_get_window()Carlos Garnacho2011-05-181-9/+41
| | | | | | | | | This method can be implemented by event translators so they return the right window from XGenericEventCookie events, as ev->xany.window isn't meaningful for these. GdkEventSource now also uses this to find out the right window filters to apply.
* gdk: Move XGetEventData() call to GdkEventSourceCarlos Garnacho2011-05-181-23/+27
| | | | | | This function should be called just once across every possible event translator and GdkFilterFunc that wants to deal with any cookie event.
* x11: Fill in event->any.window before calling filter functionsBenjamin Otte2011-02-011-4/+4
| | | | | | a) We advertise it for GdkFilterFunc b) It's necessary to differentiate between different event types with multi-backend GTK.
* x11: Rename GdkDisplayX11 to GdkX11DisplayBenjamin Otte2010-12-211-2/+2
| | | | Also rename all the macros etc.
* x11: Rename GdkDisplayX11 to GdkX11DisplayBenjamin Otte2010-12-211-2/+2
|
* Clean up gdkx.h a bitMatthias Clasen2010-12-211-1/+2
| | | | | | | Moving the direct-access redefinitions of various macros to gdkprivate-x11.h and use that header throughout in x11/. Also remove a workaround for a long-fixed X server bug.
* Rename _gdk_event_mask_table to _gdk_x11_event_mask_tableMatthias Clasen2010-12-211-2/+2
|
* Multiple changes to reduce the amount of unprefixed symbolsMatthias Clasen2010-12-211-5/+5
| | | | | | | | | | | The X11 backend exports a number of symbols which are _-prefixed (so don't become part of the gdk api), but are not named in a way to prevent accidental clashes between backends. The one API change here is that the gdk_xid_table functions have been removed - they did not server an purpose, since the xid table only stores windows anyway, and we already have a lookup-by-xid function for windows.
* Move event source apis to gdk_x11Matthias Clasen2010-12-211-13/+13
| | | | Reduces the changes of cross-backend collisions
* Make gdk_window_{lookup,foreign_new}_for_display backend specificMatthias Clasen2010-12-211-1/+1
| | | | | At the same time, make GDK_IS_DISPLAY_X11 available in gdkx.h, and add some exemplaric ifdefs to GTK+ code.
* Add a vfunc for _gdk_events_queueMatthias Clasen2010-12-211-9/+9
|
* Work toward turning GdkDisplayManager into a backend singletonMatthias Clasen2010-12-211-33/+0
| | | | | | | | | | | This commit hides the GdkDisplayManager instance and class structs, adds vfuncs for listing displays, opening displays, and getting and setting the default display. The X11 backend has a derived GdkDisplayManagerX11. The gdk_display_manager_get() function is responsible for deciding on which of the compiled in backends to use. Currently, it consults the GDK_BACKEND environment variable and falls back to x11.
* gdk: Fix GdkWindowFilter internal refcountingColin Walters2010-12-171-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running gnome-shell under valgrind, I saw the attached invalid write. Basically we can destroy a window during event processing, and the old window_remove_filters simply called g_free() on the filter, ignoring the refcount. Then later in event processing we call filter->refcount--, which is writing to free()d memory. Fix this by centralizing list mutation and refcount handling inside a new shared _gdk_window_filter_unref() function, and using that everywhere. ==13876== Invalid write of size 4 ==13876== at 0x446B181: gdk_event_apply_filters (gdkeventsource.c:86) ==13876== by 0x446B411: _gdk_events_queue (gdkeventsource.c:188) ==13876== by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410) ==13876== by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317) ==13876== by 0x4AB7159: g_main_context_dispatch (gmain.c:2436) ==13876== by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087) ==13876== by 0x4AB806A: g_main_loop_run (gmain.c:3295) ==13876== by 0x8084D6B: main (main.c:722) ==13876== Address 0x1658bcac is 12 bytes inside a block of size 16 free'd ==13876== at 0x4005EAD: free (vg_replace_malloc.c:366) ==13876== by 0x4ABE515: g_free (gmem.c:263) ==13876== by 0x444BCC9: window_remove_filters (gdkwindow.c:1873) ==13876== by 0x4454BA3: _gdk_window_destroy_hierarchy (gdkwindow.c:2043) ==13876== by 0x447BF6E: gdk_window_destroy_notify (gdkwindow-x11.c:1115) ==13876== by 0x43588E2: _gtk_socket_windowing_filter_func (gtksocket-x11.c:518) ==13876== by 0x446B170: gdk_event_apply_filters (gdkeventsource.c:79) ==13876== by 0x446B411: _gdk_events_queue (gdkeventsource.c:188) ==13876== by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410) ==13876== by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317) ==13876== by 0x4AB7159: g_main_context_dispatch (gmain.c:2436) ==13876== by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087) https://bugzilla.gnome.org/show_bug.cgi?id=637464
* gdk: Replace direct calls of _gdk_event_func with _gdk_event_emit()Benjamin Otte2010-12-021-2/+1
| | | | For now that function just calls the event func.
* gdk: Rename GdkWindowObject to GdkWindowBenjamin Otte2010-12-021-3/+2
| | | | ... and remove most of the casting that used to be necessary.
* Make gdk_event_apply_filters safe against changes in filter listWilliam Jon McCann2010-11-221-5/+25
| | | | | | | | | | | | | An event filter may add or remove filters itself. This patch does two things to address this case. The first is to take a temporary reference to the filter while it is being used. The second is to wait until after the filter function is run before determining the next node in the list to process. This guards against changes to the next node. It also does not run functions that have been marked as removed. Though I'm not sure if this case can arise. https://bugzilla.gnome.org/show_bug.cgi?id=635380
* Inclusion cleanups in sourcesMatthias Clasen2010-10-141-0/+1
| | | | Try to do inclusions in the same sequence, more or less.
* Fix bugs that crashed gdk_display_close() on x11Havoc Pennington2010-09-181-0/+5
| | | | | | | | * _gdk_device_set_associated_device() did not allow NULL device * GdkDisplay should dispose device manager to avoid devices trying to touch the display in finalize * GdkDeviceManagerXI did not ref devices in id hash * GdkDisplayX11 did not ref devices in ->input_devices
* gdk/: fully remove gdkalias hacksJavier Jardón2010-07-101-4/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=623845
* Use g_source_set_name for all custom GSources in GTK+Colin Walters2010-06-031-0/+5
| | | | | | | Naming the sources allows easier debugging with e.g. SystemTap probes. https://bugzilla.gnome.org/show_bug.cgi?id=620511
* Merge the xi2-for-master branchMatthias Clasen2010-05-251-0/+427