Commit Graph

21126 Commits

Author SHA1 Message Date
Javier Jardón
8f3f5fab27 migrating-GtkComboBox.sgml: Do not use deprecated API in the examples 2012-01-02 02:49:20 +01:00
Alexander Larsson
e9b0f9e81a [win32] Fix win32 theme crash on offscreen windows
We add _gdk_offscreen_window_get_real_drawable to get the real
pixmap impl for offscreen windows, then we use this
in gdkgc-win32.c:get_impl_drawable() for offscreen windows
This fixes a crash when rendering win32 theme parts on
offscreen windows (bug #623563)
2011-12-16 09:11:59 +01:00
Alexander Larsson
f8170ee873 Move GdkOffscreenWindow basic type info to gdkinternals.h
This is needed to handle runtime checks for GdkOffscreenWindows
outside of gdkoffscreenwindow.c
2011-12-16 09:11:58 +01:00
Federico Mena Quintero
400e53c568 bgo#662814 - Don't print a g_warning() when GtkRecentManager can't find a file
Also, *do* add the file to the recently-used list, even if the file does not
exist yet.  This is used from the Save dialog, so even shitty apps which don't
add the file to GtkRecentManager, will get the file added from the Save dialog.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-12-13 11:07:42 -06:00
Matthias Clasen
4eae58ab43 Revert be1eea612c
Calling gdk_keymap_add_virtual_modifiers causes _all_ virtual
modifiers to be added, which causes problem when they are co-located
on the same real modifier (as Super and Hyper often are). Effectively,
this made it impossible to enter key combinations involving Super,
since they all turn into Super+Hyper.
2011-12-08 12:46:55 -05:00
Matthias Clasen
7c9f317b64 Test some virtual modifiers
This adds some accelerators involving Super and Hyper to testmerge.
This helps in testing our accel matching for those.
2011-12-08 08:04:34 -05:00
Dieter Verfaillie
81955757bc win32: don't rely on GTK_IS_H* or GTK_IS_V_* macros
But use the orientable interface instead. This has already proven
usefull for GtkVolumeButton widgets (see previous commit) so apply
the same logic all over the place.
2011-12-07 20:01:18 +01:00
Dieter Verfaillie
60d471b2d0 win32: Fix vertical GtkVolumeButton widget rendering.
The trough was being rendered horizontal for vertical
GtkVolumeButton widgets. Not relying on GTK_IS_VSCALE
but using the orientable interface instead fixes this.
2011-12-07 20:01:12 +01:00
Dieter Verfaillie
af309a50af win32: correct the notebook tab gap_side vs tab_pos comment 2011-12-07 20:01:06 +01:00
Dieter Verfaillie
7cfefd6e98 win32: fix expander rendering for horizontal GtkToolItemGroups
Expanders are usually drawn as little triangles and unfortunately
do not support rotated drawing modes. So a hack is applied (see
gtk_tool_item_group_header_expose_event_cb for details) when
drawing a GtkToolItemGroup's header for horizontal GtkToolShells,
forcing the triangle to point in the right direction. Except we
don't draw expanders as triangles on Windows. Usually, expanders
are represented as "+" and "-". It sucks for "+" to become "-" and
the inverse when we don't want to, so reverse the hack here.
2011-12-07 20:01:00 +01:00
Dieter Verfaillie
d9906a9ac4 win32: clean up detail checks
By borrowing the DETAIL macro from clearlooks' clearlooks_style.c
2011-12-07 20:00:55 +01:00
Dieter Verfaillie
980133d732 win32: set msw-button child-displacement-x & y to 0 when XP theme is active
Active buttons have not had their contents (icon & label)
displaced ever since uxtheming became available in Windows XP.

We still care about this displacement for classic themes
though (even on Vista/7 where classic themes are used to
implement High Contrast support).
2011-12-07 20:00:41 +01:00
Dieter Verfaillie
3df3cafdbb win32: Make all GDK_WINDOW_TEMP always on top
This makes menus, popups and tooltips show above the windows
task bar.

Backported from commit 62b505174f
on master branch.
2011-12-07 20:00:35 +01:00
Dieter Verfaillie
f7354da574 win32: remove unused (and commented out) combo_box_draw_arrow 2011-12-07 20:00:26 +01:00
Alexander Larsson
ba8c4bb049 win32: Fix 16bit pixmaps
This reverts to the old dibsection creation code for 16bit depth.
This makes the non-cairo stuff work, we then access the bits as
a cairo image surface, which isn't 100% right, but might be good
enough.

Fixes bug 665013
2011-12-06 11:29:00 +01:00
Matthias Clasen
4fc684943b Fix gtk-demo drawingarea example
Patch by Martin Schlemmer, bug 665011.
2011-11-30 12:09:21 -05:00
Florian Müllner
26b749440b build: Add gmodule-2.0 dependency for gtk-query-immodules-2.0 2011-11-28 15:11:06 -05:00
John Ralls
7c77f9a69a [Bug 664238] GTK apps crash when dragging something
Corrects a bad condition in a test in fadc82ad.
2011-11-20 10:28:15 -08:00
Michael Natterer
2e06f63743 Bug 663856 - Make option-foo accelerators use the right symbol
If the keyboard group shifting modifier is *also* a normal
accelerator modifier, we need to special case it when calling
gdk_keymap_translate_keyboard_state(), so we get the right
key symbol for accelerators (for example we want Option-O,
not Option-Ø displayed in menu items). This patch should only
affect quartz where the Alt key both shifts the group and can
be used as accel modifier, and not X11 or Win32 where AltGr
is not used for accelerators.

- fix quartz' gdk_keymap_translate_keyboard_state() to return
  the right consumed_modifiers
- add _gtk_translate_keyboard_accel_state() which does the
  special casing
- use it everywhere instead of gdk_keymap_translate_keyboard_state()
2011-11-18 12:25:03 +01:00
Michael Natterer
4c35d987df notebook: don't leak the action widgets
The notebook owns them, so it must destroy them in destroy().
2011-11-17 00:53:29 +01:00
Cosimo Cecchi
5c3bb1839c Revert "iconview: layout items immediately when setting a GtkTreeModel"
It makes GtkIconView segfault on GTK 2.24.

gtk_icon_view_expose() calls gtk_icon_view_layout() first thing if
there's a layout queued anyway, so we wouldn't end up in the same
situation causing the crash the original patch is supposed to fix.

This reverts commit 5a03f4a6a5.

https://bugzilla.gnome.org/show_bug.cgi?id=663138
2011-11-16 17:39:18 -05:00
Michael Natterer
0729cdc9a1 quartz: fix a race condition when waking up the CGRunLoop
Wake up the run loop unconditionally (don't check if it is waiting) because
it might go into waiting state right after we checked for it. Fixes GIMP
startup (which has a lot of GIOChannel I/O but zero NSEvents) from several
minutes to a few seconds.
2011-11-11 23:54:23 +01:00
Alexander Larsson
7546eeaa62 Post release version bump 2011-11-10 19:54:38 +01:00
Alexander Larsson
758fec0a2d Update docs from release 2011-11-10 19:49:52 +01:00
Alexander Larsson
4edbdeff64 Update NEWS for release 2011-11-10 19:29:10 +01:00
Dieter Verfaillie
1b58117bbf win32: fix GDK_DEBUG="draw" crasher
When running with GDK_DUBUG="draw", gdk_win32_draw_rectangle
calls _gdk_win32_drawable_description, which calls
gdk_drawable_get_size for a GdkWindowImplWin32.

gdk_drawable_get_size then tries to call
GDK_DRAWABLE_GET_CLASS (drawable)->get_size, which points
to NULL for GdkWindowImplWin32.

Adding the missing drawable_class->get_size implementation
fixes this.
2011-11-09 14:52:04 +01:00
Dieter Verfaillie
d8c2db3335 win32: plug leak when drawing handles
The cairo context was always created but only ever used
and destroyed(!) in the second if block (!GTK_IS_PANED (widget))
so moving around the gdk_cairo_create call would have
been the obvious fix.

However, said if block is not used at all, so clean
up draw_handle instead.

https://bugzilla.gnome.org/show_bug.cgi?id=663543
2011-11-09 14:51:55 +01:00
Alexander Larsson
2ae574ab6d win32: Let cairo create DIBs for GdkPixmap
The win32 code for GdkPixmap dib creation workes as such, but
when creating a cairo surface for it with cairo_win32_surface_create
from the HDC it fails for any bitmap format than RGB24, due to
assumptions in cairo.

In order to create a cairo surface for e.g. A1 formats we need
to let cairo create the surface via cairo_win32_surface_create_with_dib.
Additionally, we must then make sure to use this surface in
gdk_drawable_ref_cairo_surface, and to not create a new HDC for
it but reuse the cairo one (as only one HDC can write to a bitmap).

Even with this fixed there are some issues with current cairo, as
cairo A1 format isn't quite the same as win32 monochrome bitmaps.
Fixes for cairo will be submitted.
2011-11-09 13:33:19 +01:00
Alexander Larsson
36f2f822f2 win32: Make sure to set is_foreign for foreign pixmaps 2011-11-09 13:33:19 +01:00
Alexander Larsson
a9b127660b win32: Fix up error message 2011-11-09 13:33:18 +01:00
Alexander Larsson
b2f91bcb8f win32: GDIFlush before accessing pixmap bits 2011-11-09 13:33:18 +01:00
Kristian Rietveld
013c9169f6 Bug 661997 - Gtk crashes when changing the TreeView model while ...
Simply stopping rubber banding in gtk_tree_view_set_model() eliminates
the crash.  Reported by Thomas Perl.
(cherry picked from commit 91ae19768e)
2011-11-09 08:49:12 +01:00
Michael Natterer
3b5c5710da quartz: include all buttons' state in GdkEventMotion.state 2011-11-09 00:34:45 +01:00
Michael Natterer
a381e8ea62 quartz: include all buttons' states in GdkEventButton.state 2011-11-09 00:25:01 +01:00
Michael Natterer
d8cf87983e Bug 663605 - Fix event->state of many event types on quartz
Don't try to remember the current keyboard modifier and mouse button
states from the last event, because that isn't always right, and don't
set event.state = 0 for generated events. Instead, add private functions
to get the current states, and implement them with API that retrieves
these states independently from an event.
2011-11-08 21:46:30 +01:00
Matthias Clasen
7e1e5451d4 Don't use deprecated Pango api 2011-11-08 12:40:58 -05:00
Matthias Clasen
e4cee92e22 Don't use deprecated Pango api 2011-11-08 12:40:48 -05:00
Cosimo Cecchi
5a03f4a6a5 iconview: layout items immediately when setting a GtkTreeModel
As the draw handler expects the items to be laid out already, we cannot
queue a layout here to avoid a race condition with the resize that is
queued immediately after, which in turn would lead to a segfault later
in the paint_item() implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=663138
2011-11-08 12:40:31 -05:00
Matthias Clasen
b424735a39 Print dialog: small keynav improvement
Mark the page range entry and the copies spin button as
activates-default.

https://bugzilla.gnome.org/show_bug.cgi?id=662670
2011-11-08 12:40:11 -05:00
Matthias Clasen
0f22ef3f31 GtkSearchEngineTracker: port to tracker 0.12
We simply use the Tracker DBus api here, caching and direct
access that come with libtracker-sparql are probably not needed
here. Based on a patch by Martyn Russell.

https://bugzilla.gnome.org/show_bug.cgi?id=658272
2011-11-08 12:36:23 -05:00
Antoine Jacoutot
4a22e2ceab gtkmountoperation-x11: unbreak compilation on OpenBSD.
Add missing header to prevent undeclared definitions.
Bug #659565
2011-11-08 12:31:46 -05:00
Richard Hughes
6a4a78d6a2 Fix a segfault if the GAppInfo does not have an icon
This fixes the following backtrace:

 0  g_logv (log_domain=0x7ffff60461a4 "GLib-GObject", log_level=<optimized out>,
    format=0x7ffff599c322 "%s: assertion `%s' failed", args1=0x7fffffffc418) at gmessages.c:577
 1  0x00007ffff59312d2 in g_log (log_domain=<optimized out>, log_level=<optimized out>,
    format=<optimized out>) at gmessages.c:591
 2  0x00007ffff601c3c7 in g_object_ref (_object=0x0) at gobject.c:2648
 3  0x00007ffff7721e22 in gdk_x11_app_launch_context_get_startup_notify_id (context=<optimized out>,
    info=0x7fffe8004b40, files=<optimized out>) at gdkapplaunchcontext-x11.c:331
 4  0x00007ffff62e60d0 in _g_desktop_app_info_launch_uris_internal (appinfo=0x7fffe8004b40, uris=0x0,
    launch_context=0x7fffe401c800, spawn_flags=G_SPAWN_SEARCH_PATH, user_setup=0, user_setup_data=0x0,
    pid_callback=0, pid_callback_data=0x0, error=0x7fffffffc848) at gdesktopappinfo.c:1269
 5  0x00007ffff62e630a in g_desktop_app_info_launch_uris (appinfo=<optimized out>, uris=<optimized out>,
    launch_context=<optimized out>, error=<optimized out>) at gdesktopappinfo.c:1341
 6  0x00007ffff62e636b in g_desktop_app_info_launch (appinfo=0x7fffe8004b40, files=<optimized out>,
    launch_context=0x7fffe401c800, error=0x7fffffffc848) at gdesktopappinfo.c:1388
2011-11-08 12:29:11 -05:00
Chun-wei Fan
278325f611 msw_style.c: Use G_PI rather than M_PI
M_PI is not universally available...
2011-11-08 12:37:15 +08:00
Chun-wei Fan
7e8d3aa812 Update GTK+ DLL Visual C++ projects
Include the MS-Windows themes engine into the main GTK+ DLL in the build
2011-11-08 11:09:56 +08:00
John Ralls
fadc82ad26 [Quartz Bug 663182] NSImage throws an exception from _gtk_quartz_create_image_from_pixbuf()
If _gtk_quartz_create_image_from_pixbuf is given a pixbuf with size 0, 0
or which produces an NSImage with size 0.0, 0.0, it throws an exception
which Gtk doesn't handle.
2011-11-07 13:41:14 -08:00
Michael Natterer
32b70a56d1 gdk: exclude MOD1 from the virtual modifier mapping
which effectively nails down the MOD1 == ALT assumption that is valid
in all other parts of GTK+. After the modifier abstraction fixes for
OSX, the virtual mapping is now (correctly) used in more places, and
caused problems with the common default PC keyboard layout on X11 that
colocates ALT and META on the same key.
(cherry picked from commit ac943bf69a)
2011-11-07 20:19:05 +01:00
Alexander Larsson
c3601481b7 Merge branch 'gtk-2-24-win32' into gtk-2-24 2011-11-07 15:07:01 +01:00
Dieter Verfaillie
fe67f04a16 win32: fix scrolling artifacts
When scrolling a window partially obscured by another window,
artifacts of the obsuring window where being blitted into
the newly scrolled position. In other words, BitBlt copies
the covered region (basically garbage instead of what we want)
and does not cause a repaint (unlike how XCopyArea behaves).

Replacing BitBlt() with the old ScrollDC gymnastics (removed from
blit_inside_window() in commit e96a41be45)
when being passed a Window for blit_inside_drawable() makes these
artifacts go away.

Thanks to Alexander Larsson for figuring out the cause and
pointing out possible solutions.
2011-11-07 14:56:38 +01:00
Michael Natterer
6f4a6b4936 quartz: handle recursive CFRunLoops
Fixes e.g. crashs when dropping from finder.

Turn the "getting_events" boolean into a counter to handle poll_func()
being called recursively, and track the loop depth correctly by
changing its counter before bailing out in run_loop_observer_callback().
This way we reallocate our autorelease pool at the right time, and
don't kill memory that is still in use by outer run loops.

Also drain, not release the pool, just for some defensive forward
compatibility.
2011-11-06 23:12:57 +01:00
Kristian Rietveld
5123ad079e quartz: make gdk_quartz_osx_version conform to coding style 2011-11-06 09:34:39 +01:00