summaryrefslogtreecommitdiff
path: root/gdk/gdkwindow.c
Commit message (Collapse)AuthorAgeFilesLines
* gdk: Fix invalidation w/ pixel cache when changing child window geometry.Alexander Larsson2015-11-091-7/+17
| | | | | | | | When moving/scrolling a child window we can't use the current clip region to limit what is invalidated, because there may be a pixel cache that listens for changes outside the clip region. Instead invalidate the entire area and rely on the invalidation code to limit the repaint to the actually visible area.
* Don't use g_slist_next in gdkMatthias Clasen2015-10-201-3/+3
| | | | We generally just use ->next directly.
* Remove overhead in gdk_window_get_user_dataMatthias Clasen2015-09-281-2/+0
| | | | | This function is called very frequently during in GTK+'s drawing paths, and thus should not carry unexpected costs.
* gdkwindow: Fix list_insert_link_beforeAlexander Larsson2015-09-211-0/+3
| | | | We forgot to set prev->next to the new link
* gdkwindow: avoid multiple walking of children listChristian Hergert2015-09-141-2/+11
| | | | | This counts the number of children and fetches the last GList node at the same time.
* gdkwindow: Avoid list allocation and object refs during repaintAlexander Larsson2015-09-141-10/+25
| | | | | | | | | | | There is no need to ref the windows we're ignoring, so collect and ref only the affected child windows. Also, use a on-stack array rather than allocating a linked list. Also, we don't need to ref during the event emissions too, as we already hold a ref. https://bugzilla.gnome.org/show_bug.cgi?id=754687
* gdkwindow: Store children list nodes in GdkWindow structureAlexander Larsson2015-09-131-18/+51
| | | | | | | | | | | | | | This avoids a bunch of allocations, and additionally it has better cache behaviour, as we don't follow pointers to the separate GList node memory areas during traversal. From Christian Hergert: This machine is a Retina mac book pro so I've been working on getting GtkTextView (GtkPixelCache) up to our performance level on X11/Wayland. I'm seeing a jump from about 43 FPS to about 50 FPS. https://bugzilla.gnome.org/show_bug.cgi?id=754687
* gdk window: Convert to g_object_notify_by_pspecMatthias Clasen2015-09-061-10/+11
| | | | This avoids pspec lookup overhead in g_object_notify.
* gdk window: Remove an unneeded variableMatthias Clasen2015-09-061-4/+1
| | | | The G_DEFINE_TYPE macros automate the parent_class handling.
* Trivial formatting fixMatthias Clasen2015-08-281-2/+1
|
* gdk: Proxy touchpad events through the client-side window hierarchyCarlos Garnacho2015-08-121-1/+100
| | | | | | This includes poking the deepmost window, checking for the GDK_TOUCHPAD_GESTURE_MASK bit set, and translating coordinates in events accordingly.
* gdk: Add GDK_TOUCHPAD_GESTURE_MASK to GdkEventMaskCarlos Garnacho2015-08-121-1/+3
| | | | | Users will need to manually select on this in order to receive gesture events.
* Added api to set a window to fullscreen on a given monitor.Jeremy Whiting2015-07-251-0/+26
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=752677
* gdk: Add some parameter checkingMatthias Clasen2015-07-171-0/+2
| | | | | This may help coverity recognize that we're not called with invalid combinations.
* Fix up doc commentsMatthias Clasen2015-06-231-2/+1
|
* Fix return value error in gdk_window_set_pass_throughTing-Wei Lan2015-06-171-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=751099
* gdkwindow: avoid updating background pattern if it matches previousChristian Hergert2015-06-161-0/+15
| | | | | | Background patterns are often updated when style changes. In many cases, the new pattern will match the previous. We can optimize out the invalidation that will occur upon resetting the same pattern.
* gdk: Add gdk_window_set_pass_throughAlexander Larsson2015-06-151-4/+121
| | | | | | | | | | | | | | | | | | | | | An pass_through window is something you can draw in but does not affect event handling. Normally if a window has with no event mask set for a particular event then input events in it go to its parent window (X11 semantics), whereas if pass_through is enabled the window below the window will get the event. The later mode is useful when the window is partially transparent. Note that an pass-through windows can have child windows that are not pass-through so they can still get events on some parts. Semantically, this behaves the same as an regular window with gdk_window_set_child_input_shapes() called on it (and re-called any time a child is changed), but its far more efficient and easy to use. This allows us to fix the testoverlay input stacking test. https://bugzilla.gnome.org/show_bug.cgi?id=750568 https://bugs.freedesktop.org/show_bug.cgi?id=90917
* Remove an unused variableMatthias Clasen2015-06-131-2/+0
|
* Fix 'void function should not return void expression' warning for clangTing-Wei Lan2015-06-131-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=750888
* Fix use-after-free in gdk_window_end_paint()Руслан Ижбулатов2015-04-301-1/+1
| | | | It's a miracle that this code ever worked.
* Improve the docs for gdk_window_set_opaque_regionMatthias Clasen2015-04-181-3/+3
| | | | | Fix several typos and annotate the region parameter as allow-none.
* gdkwindow: Fix potential NULL pointer dereferencePhilip Withnall2015-03-091-0/+3
| | | | | | | | | | gdk_window_ensure_native() can end up with a NULL parent pointer, which it passes to find_native_parent_above()…but that expects a non-NULL parent. Found with scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=712760
* docs: Expand input handling documentation to cover event masksPhilip Withnall2015-02-191-0/+4
| | | | | | | | | Also try and clarify a few things about event propagation. Move input-handling.xml into gtk-doc’s expand_content_files variable so it automatically links to widget documentation. Add links from gtk_widget_add_events() and friends to the new documentation. https://bugzilla.gnome.org/show_bug.cgi?id=744054
* Do not use "return" when chaining up to a void functionPaolo Borelli2015-02-171-5/+5
|
* gl: Drop profile for gdk_window_create_gl_context()Emmanuele Bassi2015-02-121-5/+1
| | | | | | Now that we have a two-stages GL context creation sequence, we can move the profile to a pre-realize option, like the debug and forward compatibility bits, or the GL version to use.
* gl: Drop OpenGL legacy profileEmmanuele Bassi2015-02-091-13/+1
| | | | | | | | | | | | | We simply don't want to care about legacy OpenGL. All supported platforms also have support for OpenGL ≥ 3.2; it would complicate the internal code; and would force us to use legacy GL contexts internally if the first context created by the user is a legacy GL context, and disable creation of core-3.2 contexts after that. We will need to fix all our code examples to use the Core 3.2 profile. https://bugzilla.gnome.org/show_bug.cgi?id=741946
* GL: Split GL context creation in two phasesEmmanuele Bassi2015-02-091-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the major requests by OpenGL users has been the ability to specify settings when creating a GL context, like the version to use or whether the debug support should be enabled. We have a couple of requirements in terms of API: • avoid, if at all possible, the "C arrays of integers with attribute, value pairs", which are hard to write and hard to bind in non-C languages. • allow failing in a recoverable way. • do not make the GL context creation API a mess of arguments. Looking at prior art, it seems that a common pattern is to split the construction phase in two: • a first phase that creates a GL context wrapper object and does preliminary checks on the environment. • a second phase that creates the backend-specific GL object. We adopted a similar pattern: • gdk_window_create_gl_context() creates a GdkGLContext • gdk_gl_context_realize() creates the underlying resources Calling gdk_gl_context_make_current() also realizes the context, so simple GL users do not need to care. Advanced users will want to call gdk_window_create_gl_context(), set up the optional requirements, and then call gdk_gl_context_realize(). If either of these two steps fails, it's possible to recover by changing the requirements, or simply creating a new GdkGLContext instance. https://bugzilla.gnome.org/show_bug.cgi?id=741946
* Be safe against stray booleansMatthias Clasen2015-02-011-1/+1
| | | | | | | Since gboolean is a typedef for int, the compiler won't complain about gdk_window_set_event_compression (w, 2). So, make it work. https://bugzilla.gnome.org/show_bug.cgi?id=742566
* Fix an oversightMatthias Clasen2015-01-301-4/+2
| | | | | | | Commit ff256956b2072cd422 introduced a frame_clock_events_paused flag, but only ever set it to TRUE, instead of unsetting it when events are resumed. This was leading to assertion failures in _gdk_display_unpause_events().
* Resume events when disconnecting from a frame clockTom Hughes2015-01-301-0/+9
| | | | | | | | If we are disconnecting from a frame clock that has paused event processing and hasn't issued a resume yet make sure we resume the events or they will stay blocked forever. https://bugzilla.gnome.org/show_bug.cgi?id=742636
* GDK GL context's should associate with "window->impl_window" not "window"Niels Nesse2015-01-281-3/+3
| | | | | | | | | | In some layouts this inconsistency results in crashes in gdk_gl_texture_from_surface() since it uses gdk_gl_context_get_window() but the returned window is not the same as the one that is being painted so "window->current_paint.surface" is NULL. I saw this problem when packing a GdkGLArea into a GtkPaned. https://bugzilla.gnome.org/show_bug.cgi?id=743146
* Fix core context creation in GdkGLContextNiels Nesse2015-01-281-1/+0
| | | | | | | | | | | | | | | - Specifically request GL version when creating context. Just specifying core profile bit results in the requested version defaulting to 1.0 which causes the core profile bit to be ignored and an arbitrary compatability context to be returned. - Fix GL painting by removing GL calls that have been depricated by the 3.2 core profile. - Additionally remove glInvalidateFramebuffer() call, it is not supported by 3.2 core. https://bugzilla.gnome.org/show_bug.cgi?id=742953
* Initialize variablesMatthias Clasen2015-01-241-0/+2
| | | | | | | No need to risk valgrind complaints about initialized values. https://bugzilla.gnome.org/show_bug.cgi?id=743422
* Fix a typo in the docsMatthias Clasen2015-01-181-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=743037
* Remove some outdated referencesMatthias Clasen2015-01-181-9/+11
| | | | | We shouldn't recommend gtk_widget_modify_bg() or gtk_style_set_background() anymore.
* gdkwindow: Clean up whitespace slightlyJasper St. Pierre2014-11-221-1/+0
| | | | This has been bothering me for a while.
* gdkwindow: Don't pass the region to the impl when beginning a paintJasper St. Pierre2014-11-221-2/+2
| | | | | | It's unused. At the same time, rename "begin_paint_region" to "begin_paint". This will help us clean up how GDK painting works in the future to allow more creative use of double-buffering.
* Add gdk_window_get_unscaled_sizeAlexander Larsson2014-11-201-0/+31
| | | | | | | | | This is required for the X backend GL integration. If the window has a height that is not a multiple of the window scale we can't properly do the y coordinate flipping that GL needs. Other backends can ignore this and use the default implementation. https://bugzilla.gnome.org/show_bug.cgi?id=739750
* gdk: Make debug-updates a per-display settingMatthias Clasen2014-11-101-4/+8
| | | | | Add private API to set this per-display, and make the existing gdk_window_set_debug_update function set a global default.
* Move rendering mode into GdkDisplayMatthias Clasen2014-11-101-1/+3
| | | | | This is in preparation for making it runtime-settable in the inspector.
* configure.ac: Depend on cairo 1.14.0Javier Jardón2014-11-101-10/+0
| | | | This is needed for cairo_set_device_scale()
* gdk_window_end_paint: Flush destination surface after paintAlexander Larsson2014-11-101-0/+2
| | | | | It seems in cairo 1.14 we need this after having painted an image surface to a X11 window surface (i.e. with GDK_RENDERING=image).
* Hide GdkWindow libgtk_only API in the private vtableEmmanuele Bassi2014-11-081-2/+18
| | | | | | | These are the last two global GDK symbols that have a libgtk_only suffix. https://bugzilla.gnome.org/show_bug.cgi?id=739781
* Move GDK GL flags accessors to the private vtableEmmanuele Bassi2014-11-081-0/+1
| | | | | | This allows us to use the GDK_PRIVATE_CALL macro inside gtk. https://bugzilla.gnome.org/show_bug.cgi?id=739781
* Export API to set GL flagsMatthias Clasen2014-11-061-2/+2
| | | | This will be used in the inspector.
* GdkWindow: Drop gl matrix setup which is not needed anymore.Alexander Larsson2014-11-061-7/+0
|
* GdkX11GLContext: Use bitblit for swap if no buffer age supportAlexander Larsson2014-11-061-3/+0
| | | | | | | | | If buffer age is undefined and the updated area is not the whole window then we use bit-blits instead of swap-buffers to end the frame. This allows us to not repaint the entire window unnecessarily if buffer_age is not supported, like e.g. with DRI2.
* Add GDK_GL env var and GdkGLFlagsAlexander Larsson2014-11-061-7/+2
| | | | | | | | | | | | | | | | | | | | | This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always. It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG is really only about debug loggin. It also adds some completely new flags: software-draw-gl: Always use software fallback for drawing gl content to a cairo_t. This disables the fastpaths that exist for drawing directly to a window and instead reads back the pixels into a cairo image surface. software-draw-surface: Always use software fallback for drawing cairo surfaces onto a gl-using window. This disables e.g. texture-from-pixmap on X11. software-draw: Enables both the above.
* GdkWindow: Try to use a Core 3.2 GL profile for the paint contextAlexander Larsson2014-11-061-6/+20
| | | | | If this is supported we avoid a lot of legacy baggage which we don't need.