Commit Graph

3414 Commits

Author SHA1 Message Date
Alexander Larsson
b0d0bf7f7d Avoid spurious emissions of monitors-changed
The monitor change detection code in _gdk_x11_screen_size_changed() and
process_monitors_change() goes to some length to make sure its only emitted
when there is an actual change to the data visible via the GdkScreen monitors
api.

However, commit 662e69ad added some code that always emits "monitors-changed"
in _gdk_x11_screen_size_changed when we have randr13 and get a ConfigureNotify
on the root window (even though we may already have emitted it in the
RRScreenChangesNotify event!).

As far as I can tell this is due to a comment in the bug referenced by the
commit (https://bugzilla.gnome.org/show_bug.cgi?id=601712#c4) where it says:

  This version of the patch changes GdkDisplay to emit "monitors-changed" when
  the primary monitor changes (see the change in _gdk_x11_screen_size_changed).

And, if you remove this part of the change the signal is not emitted when just
the primary is changed. However, this is not really the right approach. We
should just also check for if the primary changes in process_monitors_change()
to avoid spurious signal emissions.

https://bugzilla.gnome.org/show_bug.cgi?id=643216
(cherry picked from commit 0b0f110152)

Conflicts:

	gdk/x11/gdkscreen-x11.c
2011-02-24 20:05:45 +01:00
Matthias Clasen
2baa2dc7f0 Remove annotation that breaks the introspection build 2011-02-20 18:47:40 -05:00
Tor Lillqvist
af91746931 Handle emulated keyboard input that arrives as VK_PACKET
Fixes bug #642772. Thanks to the anonymous bug reporter for providing
a test program.
2011-02-20 01:33:00 +02:00
Matthias Clasen
c14e9ee768 Fix doc comment syntax 2011-02-19 12:47:04 -05:00
Matthias Clasen
b609bd1149 Fix doc comment 2011-02-19 10:16:58 -05:00
Martin Pitt
45d05f52c2 [GI] Mark mis-detected constructors as such
constructors which take an object of the same class as its first argument are
mis-detected as method call with "self" argument by the GIR scanner. Using the
new (constructor) annotation from bug 561264, mark some of them as proper
constuctors, so that you can call them with NULL as first argument from
bindings; in particular, this fixes gdk_window_new() and the
gtk_radio_button_new_with*() constructors.
2011-02-19 09:56:53 -05:00
Martin Nordholts
fa2d05ab4e Bug 633291 - Handle Shift-keys in X11 gdk_test_simulate_key()
If a level 1 key maps to a key value passed to
gdk_test_simulate_key(), raise the GDK_SHIFT_MASK flag so the reqested
key value is generated. Also add a regression test for this fix.
2011-02-13 12:34:19 +01:00
Matthias Clasen
e3185138ac Fix the build without the Composite headers
The code was already protected by #ifdef HAVE_XCOMPOSITE, but
we forgot the include.
https://bugzilla.gnome.org/show_bug.cgi?id=642137
2011-02-12 08:06:31 -05:00
Pavel Holejsovsky
5cded4d5e2 [GI] Add missing (transfer) annotations
Backported from master commit 2f0d40335b.
2011-01-26 12:49:08 +01:00
Matthias Clasen
0455bcfda4 Expose gtk-auto-mnemonics as an Xsetting 2011-01-23 16:58:50 -05:00
Adel Gadllah
6490a22aaf GdkX11dnd: Fix build issue
I messed up while rebasing the window caches patch.
2011-01-05 17:54:29 +01:00
Matthias Clasen
644f25c497 Decouple GdkWindowCache life-cycle from GdkX11DragContext
By making window caches refcounted. This fixes problems with leaking
drag contexts, as experienced in
https://bugzilla.gnome.org/show_bug.cgi?id=637691
and
https://bugzilla.gnome.org/show_bug.cgi?id=144324

Based on a patch by drago01@gmail.com
2011-01-05 17:37:37 +01:00
Murray Cumming
87285bc8bf gdk_spawn* deprecation docs: Mention actual replacement functions. 2011-01-05 01:34:49 +01:00
Benjamin Otte
882db1cf5f gdk: Remove GTK_COMPILATION checks from headers
Now that gtk doesn't compile with GDK_DISABLE_DEPRECATED anymore,
they're not needed.
2011-01-03 19:07:07 +01:00
Benjamin Otte
9591369339 gdk: Deprecate gdk_display_set_pointer_hooks() 2011-01-03 19:07:07 +01:00
Benjamin Otte
b225585844 gdk: Deprecated gdk_set_pointer_hooks() 2011-01-03 19:07:07 +01:00
Matthias Clasen
c76b247da5 Revert some over-eager deprecation removal
We can't replace drawable api with window api when the object
is actually a pixmap.
2010-12-27 18:16:14 -05:00
Tor Lillqvist
9fb03bb402 Export gdk_x11_ functions only on X11 2010-12-27 11:30:07 +02:00
Matthias Clasen
120915d6de Reinstate the implementation of gdk_window_foreign_new_for_display
This was accidentally dropped when introducing
gdk_x11_window_foreign_new_for_display().
2010-12-23 11:58:26 -05:00
Matthias Clasen
e2361108f4 Document that keymap functions will stop accepting NULL 2010-12-23 10:15:59 -05:00
Matthias Clasen
3e9dc75768 Fix another typo 2010-12-21 18:06:54 -05:00
Matthias Clasen
8ad1c959ef Fix a typo 2010-12-21 11:35:38 -05:00
Matthias Clasen
dd05e41475 Deprecate gdk_xid_table* functions 2010-12-21 09:54:15 -05:00
Matthias Clasen
7b1c38b57c Deprecated gdk_drag_find_window and gdk_drag_get_protocol 2010-12-21 09:54:15 -05:00
Matthias Clasen
a88f8e4c57 Deprecate gdk_drag_context_new 2010-12-21 09:54:15 -05:00
Matthias Clasen
bad6d00966 Deprecate some gdk text conversion routines
And add x11-specific replacements for them
2010-12-21 09:54:15 -05:00
Matthias Clasen
e65e208d40 Deprecate gdk_set_locale and gtk_set_locale 2010-12-21 09:54:14 -05:00
Matthias Clasen
6250c1dbe1 Deprecate gdk_net_wm_supports 2010-12-21 09:54:14 -05:00
Matthias Clasen
dd1de27061 Deprecate gdkx_visual_get 2010-12-21 09:54:14 -05:00
Matthias Clasen
08e4a60de1 Deprecate gdk_spawn apis 2010-12-21 09:54:14 -05:00
Matthias Clasen
2f8c78ddc5 Deprecate foreign window apis
And add x11- and win32-specific apis for these at the same time
2010-12-21 09:54:14 -05:00
Matthias Clasen
0f8251da61 Deprecate gdk_set_sm_client_id
And add a gdk_x11_set_sm_client_id to replace it.
2010-12-21 09:54:13 -05:00
Matthias Clasen
3bdd56c928 Add some forgotten accessors for GdkDragContext
These fields are accessed in gtk.
2010-12-21 09:54:13 -05:00
Matthias Clasen
c282958fb4 Optimize gdk_window_set_shape_combine_region
When setting no shape on an unshaped window, nothing changes,
so return early instead of recomputing lots of visibility
information.

Pointed out by Owen Taylor in bug 637156.
2010-12-14 22:24:09 -05:00
Matthias Clasen
b2274ba08a Avoid delays in starting applications
Only query file info once, and don't do it for non-native files, since
that may cause sync network IO.

Bug http://bugzilla.gnome.org/show_bug.cgi?id=635588
2010-11-29 21:08:59 +01:00
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