Commit Graph

3379 Commits

Author SHA1 Message Date
Michael Natterer
d0f2b13309 gdk: add gdk_device_get_n_keys() to access the sealed num_keys member 2010-11-24 20:15:29 +01:00
Benjamin Otte
176218c5a0 API: Add gdk_pixmap_get_size()
Allows querying a pixmap's size when compiling with deprecations.
2010-11-18 17:45:14 +01:00
Michael Natterer
2ab90f5d65 gdk: cast impl to GdkWindow* when calling gdk_drawable_get_size() 2010-11-18 13:24:51 +01:00
Bastien Nocera
df08bc43ec gdk: Add XSetting for "gtk-cursor-blink-timeout"
Otherwise the blink timeout is the one used by default in GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=634697
2010-11-15 17:20:02 +00:00
Benjamin Otte
bf395263b2 gdk: Use the correct surface size when creating surfaces
Previously we used the size of the csw window, which could easily be
huge and cause CAIRO_SURFACE_INVALID_SIZE errors. If we use the real
size, we work around this problem. The surface can now potentially be
bigger than before but we should handle that when clipping in csw.

https://bugzilla.gnome.org/show_bug.cgi?id=633701
2010-11-08 16:14:14 -05:00
Hans Breuer
1050485a13 Prefer MessageBeep() over Beep()
Only the former respects the sound volume setting. If MessageBeep() fails fall back to the latter.
(cherry picked from commit 5e59db1554)
2010-11-07 22:38:20 +01:00
Kristian Rietveld
15eecb1645 quartz: release pattern in GC finalize 2010-10-24 14:39:52 +02:00
Kristian Rietveld
dfd7e05123 quartz: Reset drawable on pattern callback info when gc is updated 2010-10-24 14:39:52 +02:00
Kristian Rietveld
b0a17e5a37 Pass pixmap to _gdk_pixmap_get_cgimage() and not the impl 2010-10-24 14:39:52 +02:00
Kristian Rietveld
f62b56194b quartz: Always use generic color space
Switch all usage of device color spaces to generic color spaces.  Since
the former color spaces are no longer device-dependent as of Mac OS X
10.4, these yielded a very costly color space conversion when drawing
pixmaps to the screen.  We now avoid this by using the generic color
space.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624025
2010-10-19 10:41:01 +02:00
Kristian Rietveld
e6e9eef855 Rework GdkPixmapImplQuartz to create CGImage on-demand
If the data that backs a bitmap context changes, then the CGImage that
is backed by this data might not always update due to caching effects.
By creating the CGImage on-demand, we ascertain ourselves that the
CGImage is up to date.
2010-10-19 10:40:48 +02:00
Matthias Clasen
0200763126 Fix header inclusions for !srcdir builds 2010-10-16 16:53:44 -04:00
Christian Persch
2a646c1d21 Take cursor hotspot from pixbuf if available
Allow -1 for the hotspot coordinates in gdk_cursor_new_from_pixbuf,
if the pixbuf contains the x_hot/y_hot options with appropriate values.

Bug #632140.
2010-10-16 01:11:43 -04:00
Javier Jardón
463e6843b9 docs: Fix some docs in gdkrgb
Reported by Milan Bouchet-Valat in
https://bugzilla.gnome.org/show_bug.cgi?id=631473
2010-10-06 01:00:35 +02:00
Matthias Clasen
d1f256ac30 Backport some new GdkWindow api from 2.90
This commit adds
gdk_window_get_display
gdk_window_get_screen
gdk_window_get_visual
gdk_window_get_width
gdk_window_get_height
and deprecates the corresponding GdkDrawable APIs.
This will make it easier to prepare the port to GTK+ 3
2010-09-27 20:37:03 -04:00
Matthias Clasen
2e5251b405 Add gdk_cairo_set_source_window
And deprecate gdk_cairo_set_source_pixmap.
2010-09-27 19:00:10 -04:00
Colin Walters
62c2b4f529 introspection: Only use 0.9.3 API 2010-09-20 10:00:30 -04:00
Matthias Clasen
4850fa57f9 Fix up a botched cherry-pick 2010-09-17 11:05:42 -04:00
Matthias Clasen
0ebde0bbe5 Fix a doc comment
(cherry picked from commit 28c66ed9b0)
2010-09-17 09:49:54 -04:00
Matthias Clasen
a3fa516c60 Scan gdk/x11 sources for Gdk-3.0.gir
The doc comments (with annotations) for some of the gdk api are down
in x11/ sources, so we need to scan those too, when building Gdk-3.0.gir.
2010-09-17 09:49:19 -04:00
Matthias Clasen
27970efd52 Add annotations
The goi scanner warns about these nowadays.
(cherry picked from commit 6aa8941b84)
2010-09-17 09:47:47 -04:00
Sebastian Dröge
285ab04c0c gdk: Only use XComposite if it is available
Fixes build if it isn't available. Bug #629748.
2010-09-15 16:41:41 +02:00
Matthias Clasen
4394a972dc Fix a logic error in the gdk_display deprecation 2010-09-13 13:14:18 -04:00
Adel Gadllah
81ec8c7a1b [GdkWindowCache] Don't ignore the CompositeOverlayWindow
Add the composite overlay window to the cache, as this can be a reasonable Xdnd proxy as well.

This is only done when the screen is composited in order to avoid mapping
the COW. We assume that the CM is using the COW (which is true for pretty
much any CM currently in use).

https://bugzilla.gnome.org/show_bug.cgi?id=601731
2010-09-13 18:21:15 +02:00
Matthias Clasen
9190497b4a Don't use g_idle_add to schedule idles in GDK
We need to use gdk_threads_add_idle, in order to keep GDK code
under the GDK lock.

Bug 629277
(cherry picked from commit 08dd02fe25)
2010-09-10 22:35:36 -04:00
Matthias Clasen
a3c3031a0e Deprecate gdk_display and GDK_DISPLAY 2010-09-10 22:33:58 -04:00
Tor Lillqvist
88f54ea47d Avoid potential DLL hijacking in Wintab code
Load Wintab32.dll from an absolute path. A proper Wintab32.dll, if
present, should be in the Windows system directory, so load it from
there.
2010-09-09 20:21:03 +03:00
Colin Walters
750c81f43d gdk: Prefix keys with _KEY by default
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.  In GTK2, this header is included by default.

https://bugzilla.gnome.org/show_bug.cgi?id=629093
2010-09-08 19:07:23 -04:00
Colin Walters
ae84810db5 gdk: Update gdkkeysyms.h
In preparation for adding a namespace prefix for introspection.
2010-09-08 18:56:59 -04:00
Colin Walters
8e75ddeac6 introspection: Update to new scanner API
* Add --warn-all
* Drop unnecessary  of --strip-prefix; for GdkX11, use --symbol-prefix

https://bugzilla.gnome.org/show_bug.cgi?id=628160

Conflicts:

	configure.in
	gdk/Makefile.am
	gtk/Makefile.am
2010-09-08 11:13:12 -04:00
Matthias Clasen
bcdd895229 Avoid segfault on xkbless systems
This was reported in bug 628932 to cause problems on VNC.
(cherry picked from commit d5c2cb7bcb)
2010-09-07 00:11:55 -04:00
Benjamin Otte
ba5ba3b022 gdk: Ensure flush of surface when cairo_t is destroyed
Add an ugly workaround because GTK does not ensure surfaces get flushed
before directly accessing the drawable backed by the surface. This is
not visible on X11 (where flushing is a no-op), but can be seen on
Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=628291
2010-09-07 02:42:27 +02:00
Neil Roberts
c3c5575fc1 Initialize more attributes in gdk_window_ensure_native
The attributes struct has some members that aren't covered by the
attributes_mask so they should always be filled in. The Win32 backend
was using the window type member when creating the window
implementation. Previously this was left uninitialized so it would end
up thinking the window is input_only and nothing would get painted.

https://bugzilla.gnome.org/show_bug.cgi?id=628049

Signed-off-by: Hans Breuer <hans@breuer.org>
2010-09-05 16:01:23 +02:00
Matthew Barnes
1175e6b98c Don't leak display name
Bug 628656 - _gdk_windowing_get_startup_notify_id memory leak

get_display_name() returns a newly allocated string, which was being fed
directory info a g_strdup_printf() call.
(cherry picked from commit bf3b5f785e)
2010-09-03 12:51:24 -04:00
Tor Lillqvist
027380d33e Just use TrackMouseEvent directly
TrackMouseEvent is present in user32.dll in all Windows versions we
support. No need to look it up dynamically. No need to fallback to
_TrackMouseEvent from comctrl32.dll.
2010-09-03 00:49:02 +03:00
Lionel Landwerlin
30a52271e5 directfb: implement draw_drawable_with_src instead of draw_drawable in GdkDrawableImplDirectFB
This is required by the rotated button test in gtk-demo

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
b7b9a01efb TOFINISH: fixes on clear/scrolling
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
4509240d0e directfb: fix gdk_directfb_child_at
When GDK looks for the window under pointer, the gdk-directfb backend
looks at windows starting from the root window to the upper window in
the stack. For this, it looks at window's size and position. This
patch fix the assumption that windows are always natives windows from
which we can retrieve backend's private data.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
65f7b09b39 directfb: fix GdkPixmap creation
Since GDK has introduced the offscreen window concept, pixmap can be
created using drawables which aren't native windows. This patch fix
this assumption.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
8e958f58c9 directfb: remove useless cairo_surface cleanup
This is done by gdk_directfb_cairo_surface_destroy via cairo_surface_set_user_data.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
333d53b342 directfb: remove useless code manipulating window's private data
The window management code used to deal with gdk internals. It seems a
lot of code has been pushed to the generic gdk code, so we remove
useless code.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
737f035959 directfb: rework backend initialization a little bit
Make it look more like the x11 backend. Also some people reported
crash early in the backend initialization about some colormap stuff,
this should avoid the problem.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
2970d775ed directfb: get rid of useless gdkWindow reference in GdkWindowImplDirectFB
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
5538315d38 directfb: event manager rewrite
The event translation code used to deal a lot with gdk internals. It
seems a lot of code has been pushed to the generic gdk code, so we
needed to rewrite the things a little bit.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
ecb7734660 directfb: split gdk_directfb_event_make function
In prevision of coming event manager rewrite.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
9de2f4b9cc directfb: get rid of abs_x,abs_y computation within the backend
The computation of abs_x,abs_y is done by the generic code of GDK when
events are raised. We don't care about that anymore.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:21 +02:00
Lionel Landwerlin
68ba791720 directfb: use boilerplate macros for GdkWindow
This patch reduce boilerplate for GdkWindowImplDirectFB using G_DEFINE_TYPE macro.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
4e9be0c9e9 directfb: use boilerplate macros for GdkPixmap
This patch reduce boilerplate for GdkPixmapImplDirectFB using G_DEFINE_TYPE macro.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
000b2fa22b directfb: use boilerplate macros for GdkImage
This patch reduce boilerplate for GdkImage using G_DEFINE_TYPE macro.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
59d6e84459 directfb: drop cairo < 1.6 dependency
This removes the cairo's versions checks < 1.6 since GTK+ now requires
cairo >= 1.6.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
f8d42326ea directfb: coding style coherency
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
3c3aa2778b directfb: add missing symbols for gdk input 2.22
Also make it look more like the x11 backend.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Lionel Landwerlin
8637b3eb37 directfb: drop internal reference to gdk-pixbuf
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2010-08-31 21:08:20 +02:00
Matthias Clasen
4e2ade8d6b Make gdk_keymap_map_virtual_modifiers work early
It needs to ensure that we have an uptodate modmap. Bug 616401
(cherry picked from commit d5a8a3c9bc)
2010-08-30 12:52:40 -04:00
Philip Withnall
818ef9aaf6 Miscellaneous string fixes
Mostly capitalisation fixes. Closes: bgo#528257
2010-08-29 19:05:26 +01:00
Fridrich Štrba
895b9ff43f A proper fix for win32 build 2010-08-29 18:16:58 +02:00
Fridrich Štrba
af44019baf Revert "Fix windows build of the branch"
This reverts commit c7e650ae5d.
2010-08-29 18:16:19 +02:00
Hans Breuer
17269e6c1d win32: Fix a bunch of c99isms
With c89 (which msvc implements) variables still need to be
declared at the beginning of a block.
2010-08-29 14:31:06 +02:00
Hans Breuer
707f1a9a84 win32: Further fixing _gdk_window_impl_new()
- attributes->wclass is not consistently set anymore,
   use private->input_only instead [1]
 - don't put window into parent->children a second time
   (now there is no window reference problem anymore)
2010-08-29 14:22:08 +02:00
Fridrich Štrba
c7e650ae5d Fix windows build of the branch 2010-08-28 18:50:45 +02:00
Martin Schlemmer
770e308c42 win32: cummulated backport of xp theme fixes from master 2010-08-28 15:14:31 +02:00
Hans Breuer
e339d36a02 win32: Resurrect some enter/leave notify events for native windows
The button highlighting in testgtk works again, even with
GDK_NATIVE_WINDOWS. Unfortunately testgtk:menus still does
not work for the forced-native-window-case.
2010-08-27 21:29:33 +02:00
Hans Breuer
068515ad96 Further fix _gdk_window_impl_new() for win32 and ...
Beside fixing _gdk_window_impl_new() as adviced in
http://mail.gnome.org/archives/gtk-devel-list/2010-August/msg00214.html
the patch adds implementations for set_background, set_back_pixmap,
restack_under, restack_toplevel and clear_region methods.
2010-08-27 21:23:59 +02:00
Neil Roberts
2e08524481 win32: Never pass SWP_NOSIZE or SWP_NOMOVE to SetWindowPos
In _gdk_window_move_resize_child it tries to decide whether to pass
SWP_NOSIZE and SWP_NOMOVE based on whether the new size and position
is different from the window's existing position. However it seems
that GDK now ends up updating the window's position before calling
_gdk_window_move_resize_child so this would mean it would think the
window never changes size or position so SWP_NOSIZE|SWP_NOMOVE would
always be set. This causes child windows to never be resized.

This patch changes it so that it never passes either flag to
SetWindowPos. I don't know whether this will cause any side effects
but you'd think it shouldn't do any harm to reassert the current size.

https://bugzilla.gnome.org/show_bug.cgi?id=628049

Signed-off-by: Hans Breuer <hans@breuer.org>
2010-08-27 20:38:01 +02:00
Hans Breuer
0e781823cb Update mscv/win32 build
Fix makefiles for separated gdk-pixbuf and declare variable at
the beginning of a block (fix c99ism).
2010-08-27 20:34:23 +02:00
Matthias Clasen
1d5a6e790a Fix up some documentation issues 2010-08-16 17:38:23 -04:00
Benjamin Otte
9f1cb0798b API: Add gdk_window_get_background_pattern()
This is the suggested way for GTK3 to store a Window's background so it
makes sense to use the same function today already.
2010-08-16 20:01:49 +02:00
Kristian Rietveld
77b703c2fc quartz: stop offscreen windows code from crashing.
This is an adapted version of commit
bde0f9a8f6 on master.

Mainly fixes to properly differentiate bewteen toplevel and offscreen
windows, since these sometimes need different treatment.  Furthermore,
usage of gdk_window_get_effective_foo() instead of gdk_window_get_foo()
where applicable.

There is an drawing issue left when scrolling e.g. tree views in
offscreen windows.  I think this is likely an issue with
gdk_quartz_draw_drawable() which is used for the copy area code in
offscreen windows.  It works fine in master, since this was converted
to Cairo.
2010-08-15 17:34:33 +02:00
Benjamin Otte
370dfc16ca Remove window background getters again
They were added as accessors for 2.22 even though querying the
background wasn't possible previously. As GTK 3.0 will change background
handling, it doesn't make sense at all to expose these getters.
2010-08-15 03:31:37 +02:00
Benjamin Otte
997d3aada6 API: Add gdk_window_create_similar_surface() 2010-08-12 23:30:19 +02:00
Benjamin Otte
0e183fe745 pixmap: Deprecate create_from_data() constructors
And document that GdkPixmap will go away in GTK 3.
2010-08-12 03:02:38 +02:00
Benjamin Otte
cedf52fb81 x11: Deprecate GdkGC functions
They are gone in GTK3, just like the rest of GdkGC.
2010-08-12 01:54:58 +02:00
Benjamin Otte
e8915ae422 gdk: Undeprecate gdk_region_xor()
cairo_region_xor() does now exist, so there's no need to deprecate this
function.
2010-08-10 18:26:12 +02:00
Benjamin Otte
bff0d11c4d gdk: Deprecate GdkRGB functions 2010-08-08 02:59:21 +02:00
Benjamin Otte
a907d5e2cc Deprecate all of GdkImage 2010-08-07 22:17:43 +02:00
Benjamin Otte
8a2a736af4 Deprecated all GdkGC functions 2010-08-07 22:08:21 +02:00
Benjamin Otte
3d506df234 gdk: Deprecate all drawing functions
These functions will be gone in Gtk 3.0 and be replaced by Cairo
functions.

Includes not disabling deprecated functions in old widgets that aren't
going to be ported.
2010-08-07 15:35:51 +02:00
Benjamin Otte
f36bb4d91d gdk: Simplify deprecation guards in gdkdrawable.h 2010-08-07 15:35:49 +02:00
John Stowers
32c4f471d5 Add gdk_display_is_closed
https://bugzilla.gnome.org/show_bug.cgi?id=624224
2010-08-07 23:11:42 +12:00
Tomeu Vizoso
23f7d3a0ea Annotate gdk_rectangle_intersect 2010-07-28 16:53:14 +02:00
Tomeu Vizoso
fd75ced492 Generate GdkX11-2.0.typelib (backported from HEAD)
https://bugzilla.gnome.org/show_bug.cgi?id=625491
2010-07-28 15:03:28 +02:00
Benjamin Otte
01fea4032f gdk: Revert making get_size optional
49a0ec6e95 added this hunk without
explanations and it's obviously wrong because failing to have a get_size
vfunc will now not set width and height and they'll end up with invalid
values.

In fact, the GdkDrawableImpl{X11,Win32,Quartz} functions do not have
get_size implemented, so the patch was most likely an attempt to work
around calling this function erroneously on the impl objects.

The correct fix is to call impl->wrapper instead.
2010-07-26 11:58:23 +02:00
Benjamin Otte
e1c7ff8ee0 x11: Query size on real drawable
The X11 drawable does not have a clue about the real size of the
surface.

This might also be the cause for:
https://bugzilla.gnome.org/show_bug.cgi?id=599574
2010-07-26 11:58:23 +02:00
Emmanuele Bassi
7a68f42d2e Do not return values from a function returning void 2010-07-26 11:58:23 +02:00
John Stowers
dc2fea413b Add gdk_device_get_n_axes
https://bugzilla.gnome.org/show_bug.cgi?id=624221
2010-07-25 12:32:43 +12:00
John Stowers
6c25cf872f Add gdk_cursor_get_cursor_type
https://bugzilla.gnome.org/show_bug.cgi?id=624087
2010-07-25 12:32:38 +12:00
Tomeu Vizoso
10ebcedf56 Annotate gdk_display_manager_list_displays return value
https://bugzilla.gnome.org/show_bug.cgi?id=623307
(cherry picked from commit eae60c34d2)
2010-07-12 12:28:48 -04:00
Javier Jardón
6de36e580b [gdk] Add gdk_window_has_native() function
https://bugzilla.gnome.org/show_bug.cgi?id=622677
2010-07-01 02:39:39 +02:00
Benjamin Otte
807c14741f Deprecate GdkRegion symbols that have no Cairo equivalent
https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-06-30 16:25:03 +02:00
Philip Withnall
b89dcab5a5 Add allow-none to gdk_window_set_cursor() 2010-06-27 19:20:54 +01:00
Kristian Rietveld
e634f3fbe0 Move Leopard-specific type definitions to gdkquartz.h
Update includes subsequently where it matters.  Fixes build on Mac OS
X 10.4.
2010-06-27 10:41:15 +02:00
Kristian Rietveld
3770d914ec Refactor to use API that's available in OS X 10.4 as well 2010-06-27 10:41:15 +02:00
John Ralls
093a867e51 Bug 622333 - Crash in gdk_window_impl_quartz_begin_paint_region 2010-06-27 10:41:15 +02:00
Kristian Rietveld
9f5f47f8be Flip clip mask image when setting clip mask on GC 2010-06-27 10:41:15 +02:00
Kristian Rietveld
49f72c1fb4 Rework color translation to support gray scale and bitmaps 2010-06-27 10:41:15 +02:00
Kristian Rietveld
42d07ad6ce Add gray visual, implement "get_best" functions 2010-06-27 10:41:15 +02:00
Matthias Clasen
cbf303d8c6 Add an accessor for GdkImage->mem
See bug # 522756
(cherry picked from commit 53796b7f1f)
2010-06-26 17:00:39 -04:00
Matthias Clasen
cb29d27707 Make GTK+ build against an external gdk-pixbuf 2010-06-26 02:29:29 -04:00
Javier Jardón
7d6d1af7a1 [docs] Fix annotations: "(allow-none): (out)" -> "(out) (allow-none)" 2010-06-24 18:13:17 +02:00
Tor Lillqvist
bba451147b Generate correct grab broken event for WM_KILLFOCUS
WM_KILLFOCUS means that a keyboard grab (not a pointer grab), if any,
has been broken. I don't think this bug has matterd much as gtk
generates a grab-broken-event signal for both keybord and pointer
grabs being broken anyway.
2010-06-22 21:32:05 +03:00