summaryrefslogtreecommitdiff
path: root/gtk/gtktextview.c
Commit message (Collapse)AuthorAgeFilesLines
* TextView: add missing nullability annotationsBilal Elmoussaoui2020-12-021-3/+5
|
* textview: fix precondition assertionsChristian Hergert2020-11-241-4/+4
| | | | | | | It is a programmer error to call this with a child widget that has not been placed within the GtkTextView. Fixes #3386
* docs: Fix the links for keybinding signalsMatthias Clasen2020-11-171-13/+13
| | | | | GtkBindingSignal does not exist anymore, so link to GtkSignalAction for an explanation of keybinding signals.
* gtk/textview: Improve check for cursor-modeCarlos Garnacho2020-11-061-1/+1
| | | | | | | | | Check the text handle role, instead of looking for the other handle visibility. The other handle may be invisible during selection mode (e.g. pointing to offscreen contents). This fixes both this code switching to cursor mode out of the blue, and possible crashes later on as this handle might be hidden in the process, while its own event controller is handling events on the parent surface.
* gtk/textview: Do not forcibly show text handlesCarlos Garnacho2020-11-051-3/+0
| | | | | | | | | The gtk_text_view_set_handle_position() function called some lines above takes care of handle visibility already, also accounting for other conditions (e.g. whether the handle points to contents onscreen). Forcibly showing handles here misbehaves if the handle should stay hidden, and somewhat expensively as it involves creating and throwing a native surface every time.
* gtk/textview: Defer touchscreen focus placing to drag endCarlos Garnacho2020-11-051-5/+2
| | | | | | | | | With the scrolledwindow drag gesture not claiming the sequence immediately, we end up placing the cursor (and undoing the previous selection) each time we scroll. There is already handling too short drags in ::drag-end, so let this code handle touchscreens as well.
* gtk/textview: Clean up further if the drag gesture is taken overCarlos Garnacho2020-11-051-5/+4
| | | | | | If the gesture becomes captured (e.g. from a parent scrolledwindow), we leave some things in the air. Clean these up properly. This is recurrent with touch scroll.
* textview: Remove a broken debug output statementTimm Bäder2020-10-221-7/+1
| | | | redraw_rect does not exist.
* textview: Respect return value of get_text_surface_coords()Timm Bäder2020-10-221-4/+9
|
* gtktextview: Avoid GtkGestureClick claiming on touch pressCarlos Garnacho2020-09-251-2/+0
| | | | | We still want the drag gesture (and text selection) to work. Avoid claiming the gesture early, like it's done in the pointer case.
* textview: Make clickable tags work againMatthias Clasen2020-09-161-2/+2
| | | | | We were claiming the clicks too eagerly, preventing clickable links, e.g. in GtkAboutDialog, from working.
* textview: Fix dndMatthias Clasen2020-09-061-5/+21
| | | | | | | When we start a dnd of the selection in the drag-update handler, set the gesture state to denied. Otherwise, we get more drag-update signals, and things get really confused, leading to no dnd and sadness.
* text widgets: Don't lose focus after EmojiMatthias Clasen2020-09-021-0/+1
| | | | | | | | Make sure to grab focus back when the Emoji chooser disappears. This prevents focus going nowhere when the Emoji chooser is canceled. Fixes: #3112
* textview: Fix placement of Emoji chooserMatthias Clasen2020-09-021-0/+14
| | | | | | | If the selection extends beyond the visible range, place the Emoji chooser over the center of the window. Fixes: #3109
* *: Fix spelling mistakes found by codespellBjörn Daase2020-08-211-3/+3
|
* Drop style class definesMatthias Clasen2020-08-141-6/+6
| | | | | | We document the supported style classes by name, not by macro name, and these macros don't really add any value. Drop them for GTK 4.
* Merge branch 'scroll-to-cursor' into 'master'Matthias Clasen2020-08-081-16/+12
|\ | | | | | | | | | | | | Scroll to cursor after canceling a selection Closes #2960 See merge request GNOME/gtk!2321
| * Scroll to cursor after canceling a selectionneyfag2020-07-301-16/+12
| |
* | textview: properly remove anchored widgetsChristian Hergert2020-08-051-1/+1
| | | | | | | | Fixes #3021
* | docs: Clean up many dangling linksMatthias Clasen2020-08-041-11/+1
| | | | | | | | | | In many cases, these were references to no longer existing api, so some rewording was necessary.
* | textview: Make insert-emoji replace the selectionMatthias Clasen2020-08-021-2/+16
| | | | | | | | | | | | | | This is the expected behavior, and matches what GtkText does. Fixes: #2996
* | textview: Only claim the event when appropriateMatthias Clasen2020-08-021-13/+18
| | | | | | | | | | | | | | Don't claim the event unconditionally for the click gesture, since we may want to start a drag selection. Fixes: #2999
* | textview: Only show "insert emoji" menu item if editableTimm Bäder2020-08-011-1/+3
| | | | | | | | Fixes #2974
* | gtktextview: Avoid gdk_device_get_associated_device()Carlos Garnacho2020-07-301-2/+4
|/ | | | Query the seat for that.
* a11y: Set an accessible role for GtkTextViewMatthias Clasen2020-07-291-8/+20
| | | | | | | Use the text-box accessible role for GtkTextView and set properties as appropriate. Update the documentation and add a test.
* gdk: Conflate GDK devicesCarlos Garnacho2020-07-291-3/+3
| | | | | | | | | | Make GdkEvents hold a single GdkDevice. This device is closer to the logical device conceptually, although it must be sufficient for device checks (i.e. GdkInputSource), which makes it similar to the physical devices. Make the logical devices have a more accurate GdkInputSource where needed, and conflate the event devices altogether.
* Remove ATKEmmanuele Bassi2020-07-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To build a better world sometimes means having to tear the old one down. -- Alexander Pierce, "Captain America: The Winter Soldier" ATK served us well for nearly 20 years, but the world has changed, and GTK has changed with it. Now ATK is mostly a hindrance towards improving the accessibility stack: - it maps to a very specific implementation, AT-SPI, which is Linux and Unix specific - it requires implementing the same functionality in three different layers of the stack: AT-SPI, ATK, and GTK - only GTK uses it; every other Linux and Unix toolkit and application talks to AT-SPI directly, including assistive technologies Sadly, we cannot incrementally port GTK to a new accessibility stack; since ATK insulates us entirely from the underlying implementation, we cannot replace it piecemeal. Instead, we're going to remove everything and then incrementally build on a clean slate: - add an "accessible" interface, implemented by GTK objects directly, which describe the accessible role and state changes for every UI element - add an "assistive technology context" to proxy a native accessibility API, and assign it to every widget - implement the AT context depending on the platform For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
* Replace "gdouble" with "double"Benjamin Otte2020-07-251-50/+50
|
* Replace "gchar" with "char"Benjamin Otte2020-07-251-15/+15
|
* Replace "gint" with "int"Benjamin Otte2020-07-251-160/+160
|
* actionmuxer: Port internal usersMatthias Clasen2020-07-201-4/+4
| | | | | | Port all internal users of the action muxer from the GActionGroup interface to the new action muxer apis.
* textview: Remove unused defineTimm Bäder2020-06-271-1/+0
|
* gtktextview: Remove child textview items lastCarlos Garnacho2020-06-241-3/+3
| | | | | The function tries to go through every child, so it's convenient to remove all internal ones first.
* Drop gtknativeprivate.hMatthias Clasen2020-06-071-1/+1
| | | | No need to ship empty headers.
* gtk: Documentation fixupsMatthias Clasen2020-06-051-0/+8
| | | | Document missing symbols, and other cleanups.
* textview: Unparent the emoji chooser on disposeCarlos Garcia Campos2020-06-021-0/+7
| | | | | | This was causing the warning "GtkEmojiChooser is not a child of GtkTextView" when destroying a GtkTextView if the emoji chooser was shown.
* Fix minor typosYuri Chornoivan2020-05-281-2/+2
|
* Change coordinate translation apis to take doublesMatthias Clasen2020-05-171-5/+5
| | | | | | Change gtk_widget_translate_coordinates and gtk_native_get_surface_transform to operate on doubles. Update all callers.
* textview: Fix context menu placementMatthias Clasen2020-05-171-4/+8
| | | | | Take the surface transform into account for positioning the context menu.
* gtk: Handle seatless displaysMatthias Clasen2020-05-151-30/+50
| | | | | | | | | | | If you run weston with the headless backend, you get a Wayland display with no seat, which is just fine by the protocol. gdk_display_get_default_seat() returns NULL in this case. Various widgets assume that we always have a seat with a keyboard and a pointer, since that is what X guarantees. Make things survive without that, so we can run the testsuite under a headless Wayland compositor.
* Replace most remaining uses of container apiMatthias Clasen2020-05-111-2/+2
| | | | These are all on GtkBox or enumerating children.
* textviewchild: Derive from GtkWidgetMatthias Clasen2020-05-111-1/+1
| | | | GtkContainer is going away.
* textview: Fix popover useMatthias Clasen2020-05-111-4/+3
| | | | | There were some leftover gtk_container_add calls here on popovers on buttons, but these are no longer containers.
* textview: Derive from GtkWidgetMatthias Clasen2020-05-111-73/+10
| | | | | Drop the GtkContainer vfuncs. As a replacement for gtk_container_remove, make gtk_text_view_remove public.
* Merge branch 'wip/tintou/doc-fixes' into 'master'Matthias Clasen2020-05-111-1/+1
|\ | | | | | | | | docs: Fix several missing references in the documentation See merge request GNOME/gtk!1874
| * docs: Fix several missing references in the documentationCorentin Noël2020-05-111-1/+1
| | | | | | | | This fixes several typos and missing references
* | Replace gtk_widget_destroy everywhereMatthias Clasen2020-05-111-5/+4
|/ | | | | Replace all remaining uses of gtk_widget_destroy by gtk_container_remove or g_object_unref.
* Merge branch 'matthiasc/for-master' into 'master'Matthias Clasen2020-05-111-0/+3
|\ | | | | | | | | | | | | Matthiasc/for master Closes #2729 and #2730 See merge request GNOME/gtk!1870
| * textview: Ensure popup menu is properly insertedMatthias Clasen2020-05-101-0/+3
| | | | | | | | | | | | | | | | | | | | In the presence of attached children, the css tree and the widget tree are not in sync, so we need to explicitly set the parent of the css node before inserting the widget, or else we end up with critical warnings and a non-working menu. This can be seen in testtextview.
* | Remove lots of focus vfuncsMatthias Clasen2020-05-111-2/+0
| | | | | | | | | | In many cases, the default widget vfuncs work just fine, combined with setting focusable.