Commit Graph

21513 Commits

Author SHA1 Message Date
6931981114 label: Avoid a possible NULL dereference
We were setting attr->start before checking attr for being NULL.

Pointed out by Sami Farin,
https://bugzilla.redhat.com/show_bug.cgi?id=1140414
2015-02-13 13:39:47 -05:00
ee95f3d725 Make gdk_event_apply_filters safe against changes in filter list
An event filter may add or remove filters itself. This patch does
two things to address this case. The first is to take a temporary
reference to the filter while it is being used. The second is
to wait until after the filter function is run before determining
the next node in the list to process. This guards against
changes to the next node. It also does not run functions
that have been marked as removed. Though I'm not sure if this
case can arise.

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

Backport of 323df2b2800383832ed3c2e43626f2c6821c33ec to
the gtk-2-24 branch by Wolfgang Ulbrich.
2015-02-13 13:12:39 -05:00
436fe38cae Add support for loading gtk2-only modules
Introduce GTK2_MODULES environment variable for modules that don't work
in gtk3. The list of modules is now $GTK2_MODULES:$GTK_MODULES.

https://bugzilla.gnome.org/show_bug.cgi?id=743917
2015-02-04 13:43:49 +01:00
e48ae6f85b Bug 741959 - text input broken on OS X 10.5 from 2.24.19 onwards
Alias insertText:replacementRange: to insertText: for SDK > 10.6,
and implement insertText: for SDK < 10.6.
2015-01-04 18:16:29 -08:00
456f80a0cf Revert "Bug 741959 - text input broken on OS X 10.5 from 2.24.19 onwards"
This reverts commit 4d1c065 because with further testing it's found that
imquartz works on Leopard without it and is broken with it.
2015-01-04 12:06:57 -08:00
4d1c065ae8 Bug 741959 - text input broken on OS X 10.5 from 2.24.19 onwards
Alias insertText:replacementRange: to insertText: for SDK > 10.6,
and implement insertText: for SDK < 10.6.
2014-12-28 10:46:13 -08:00
ad6271eca9 gdk_window_begin_paint_region() - always reuse the same surface
When using the implicit paint pixmap, always draw to the same surface
(the standard one for the pixmap) each time rather than creating a new
one each time. This is both more effective and more natural.

It also fixes a redraw issue on win32, where using multiple surfaces
on the same HDC sometimes causes issues.  This seems to be due to
leftover state on the HDC from previous surfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=741060
2014-12-05 11:05:48 +01:00
5bafcca63f Ignore gdk-pixbuf deprecations
We're not going to start updating the 2.24 branch to newer
gdk-pixbuf APIs, so ignore deprecations.
2014-10-22 22:10:56 -04:00
aff976ef0d Do not leak a cairo region
This memory leak fix was present in GTK+ 3 since 3.10. We forgot
to backport it to GTK+ 2.

https://bugzilla.gnome.org/show_bug.cgi?id=738837
2014-10-20 06:17:56 -04:00
7f99fdbe90 2.24.25 2014-10-10 11:46:36 -04:00
43ece862f3 Disable deprecation warnings for tests
This is a change in newer GLib which breaks make check if we
don't disable it.
2014-10-10 11:46:36 -04:00
1d0e2d5838 pixbuf engine: Avoid a crash if widget is NULL
Commit 85f2a721cf introduced an unconditional call to
gtk_widget_get_direction(). This does not work for 'foreign'
uses of the theme engine, e.g. in Qt, where widget is NULL.

This was reported as a crash in Fedora here:
https://bugzilla.redhat.com/show_bug.cgi?id=924683
2014-09-29 16:05:57 -04:00
03c53357f6 win32: provide an implementation for gdk_test_simulate_key().
https://bugzilla.gnome.org/show_bug.cgi?id=734879
2014-09-22 21:23:31 -04:00
fbf38d16bc threads: Do not release the GDK lock if it hasn't been acquired yet
Since GLib ≥ 2.41, attempting to release an unlocked mutex will abort(),
as it happens on most systems already.

Given the lack of proper documentation on how to use GDK with threads,
there is code in the wild that does:

    gdk_threads_init ();
    gdk_init ();

    ...

    gtk_main ();

instead of the idiomatically correct:

    gdk_threads_init ();
    gdk_threads_enter ();

    gtk_init ();

    ...

    gtk_main ();

    ...

    gdk_threads_leave ();

Which means that gtk_main() will try to release the GDK lock, and thus
trigger an error from GLib.

we cannot really fix all the wrong code everywhere, and since it does
not cost us anything, we can work around the issue inside GDK itself, by
trying to acquire the GDK lock inside gdk_threads_leave() with
trylock().

https://bugzilla.gnome.org/show_bug.cgi?id=735428
2014-08-26 20:08:54 -04:00
d9164e9c60 gdk_drawable_get_screen() used for mask, which is a pixmap, not a window
The function gtk_drag_set_icon_pixmap() triggered failing assertions. This was because it called the function gdk_window_get_screen(mask), where "mask" is a pixmap, but not a window.

https://bugzilla.gnome.org/show_bug.cgi?id=735005
2014-08-20 21:46:08 -04:00
ab3e3b1834 Makefiles: cross-compilation on Linux for Windows failing.
Missing linking information for some modules.
2014-08-13 20:59:30 +00:00
267d004fd9 Fix a typo
$(bindir) starts with a slash, so no need to add an extra one in
$(DESTDIR)$(bindir)...

https://bugzilla.gnome.org/show_bug.cgi?id=734563
2014-08-10 07:58:05 -04:00
825e035833 Bug 729924 - Crash trying to print in OSX 2014-08-03 11:53:43 +02:00
d0c0d657b4 Embed manifest into gtk-update-icon-cache.exe
https://bugzilla.gnome.org/show_bug.cgi?id=705054
2014-08-02 10:51:57 +00:00
3c8f0c44e1 GtkEntry: Properly remove the completion timeout
There were some code paths where we removed the source, but
failed to reset the id to zero.

Pointed out by John Coppens in
https://bugzilla.gnome.org/show_bug.cgi?id=733689
2014-07-29 12:23:13 +02:00
f566f8811e Use AC_PATH_TOOL to find build tools.
This improves support for cross-compilation & multilib on Gentoo, where
tools proper for target arch/ABI are prefixed with CHOST.

https://bugzilla.gnome.org/show_bug.cgi?id=731582
2014-07-25 15:08:44 -04:00
0b5b2779a2 GtkButton: do not prelight in touchscreen mode
Code was copied from GtkToggleButton.

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=689138
2014-07-20 02:33:22 -04:00
6a6885c5c0 Updated Hungarian translation 2014-07-08 15:04:53 +00:00
8e5f8440a6 Build: Provide Simple Support for MSVC 2012/2013
As the Visual Studio 2012/2013 are only slightly different from the Visual
Studio 2010 projects, we can provide support for them by using scripts to
copy the Visual Studio 2010 projects, and update the specific parts as
necessary.  This is being provided to help people still needing GTK+-2.x
and also to help them to transition to GTK+-3.x easier.

Thus, there would be little maintenance overhead for these as only the 2010
projects need to be kept up-to-date as a result.  This might change when we
do get the stack working with WinRT/Metro, but that's going to be another
totally different issue.
2014-07-01 16:39:32 +08:00
6e9781c32b Fix "Installation" for Visual Studio 2010+
We need to enclose paths containing $(BinDir) with double quotes as it
points to something like c:\foo\gtk+-x.yy.zz, which the copy command on
Windows does not like "+" in paths unless enclosed in quotes.
2014-07-01 16:36:26 +08:00
9de65a11bb 2.24.24 2014-06-23 11:08:14 -04:00
72c472287b Include image data in the builtin icon cache 2014-06-23 11:08:14 -04:00
f652982062 Fix a pixmap leak in the ms-windows engine
This was pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=731967.
2014-06-22 13:11:50 -04:00
ff1f1d347d Updated Hebrew translation 2014-06-18 03:07:21 +03:00
b79cb3974c Updated Polish translation 2014-06-17 19:29:24 +02:00
30f2428671 gtk-update-icon-cache: Add an --include-image-data option
Now that we don't include the image data by default anymore,
lets add an option that  does it.

Conflicts:
	docs/reference/gtk/gtk-update-icon-cache.xml
2014-06-17 12:59:37 -04:00
85fe78ed21 updateiconcache: Don't include image data by default anymore
Since large images are in the icon cache, and apps don't tend to use that
many icons anymore, simply don't include image data and instead make apps
load files from disk. Additionally, since they're stored in GdkPixbuf data,
that means that we have to first convert them either to a cairo_surface_t,
which requires converting pixel data to be premulitplied, or an OpenGL
texture, which requires a whole GPU upload anyway.

So, even with the icon cache, the goal of icons through zero-copy, mmap()'d
data from disk just isn't doable with the icon cache format we have. The
icon cache on my disk is nearing 100MB, since we include a bunch of
high-resolution application icons, that I doubt would be used by apps at all.
Removing this inefficient pixel data makes memory usage for all applications
go down, with no speed loss.

The icon cache also, however, has an index of what icons are in each folder,
which prevents a readdir() and allows GTK+ to know what icon is where without
having to do a bunch of stat(); calls. Keeping this data is good for GTK+,
so we should still keep the index.

It doesn't make sense to remove any code for mapping pixel data from the icon
cache. There's a plan in the works to have a symbolic icon cache that does
pixel math on 16x16 icons to prevent slow SVG rendering. 16x16 pixels are
fairly small, and such images are flat colors, which should compress easily,
so the icon cache would be worthwhile here. So let's keep the code around
in preparation for that case.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-06-17 12:58:33 -04:00
a3d672a415 MSVC 2010+ Projects: Update "Installation" Process
Currently, due to the way that Visual Studio 2010+ projects are handled,
the "install" project does not re-build upon changes to the sources, as it
does not believe that its dependencies have changed, although the changed
sources are automatically recompiled.  This means that if a part or more
of the solution does not build, or if the sources need some other fixes
or enhancements, the up-to-date build is not copied automatically, which
can be misleading.

Improve on the situation by forcing the "install" project to trigger its
rebuild, so that the updated binaries can be copied.  This does trigger an
MSBuild warning, but having that warning is way better than not having an
up-to-date build, especially during testing and development.
2014-06-09 12:21:55 +08:00
46b0c29382 pixbuf-engine: Fix the build with -Werror=format-security 2014-05-23 11:19:53 +02:00
7eb1c7701c gdkselection-win32.c: Declare Variables At Top Of Block
...so that builds on Visual C++ can be fixed.
2014-05-16 12:07:01 +08:00
c9da8bddca GtkMountOperation: Clean up a dangling signal handler
Based on a patch by Eugene Shatokhin,
https://bugzilla.gnome.org/show_bug.cgi?id=723366
2014-05-06 13:38:50 -04:00
fd44b53a39 gdk/win32: VK_SNAPSHOT maps to GDK_Print
Also, I am not sure the above VK_PRINT -> GDK_Print mapping is
correct, but it doesn't hurt yet.

https://bugzilla.gnome.org/show_bug.cgi?id=686170
2014-04-24 16:29:10 +02:00
ed081e30b6 win32: do not crash on invalid utf8 conversion
g_utf8_to_utf16() is not guaranteed to succeed. Check the error
and return if it failed.

https://bugzilla.gnome.org/show_bug.cgi?id=696232
2014-04-24 16:18:09 +02:00
10430feb8d gdk/win32: remove extra allocation for \r removal
Although I can't find explicit documentation for clipboard pointer, it
seems to be possible to modify clibpoard memory without side-effects.

According to MSDN,
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366596%28v=vs.85%29.aspx

"The global and local functions are supported for porting from 16-bit
code, or for maintaining source code compatibility with 16-bit
Windows. Starting with 32-bit Windows, the global and local functions
are implemented as wrapper functions that call the corresponding heap
functions using a handle to the process's default heap."

"Memory objects allocated by GlobalAlloc and LocalAlloc are in private,
committed pages with read/write access that cannot be accessed by other
processes. Memory allocated by using GlobalAlloc with GMEM_DDESHARE is
not actually shared globally as it is in 16-bit Windows. This value has
no effect and is available only for compatibility. "

https://bugzilla.gnome.org/show_bug.cgi?id=711553
2014-04-24 16:16:19 +02:00
dd37429b51 win32: add more clipboard data checks to avoid crash
It may happen that the received clipboard data is empty, but
if it's of type image/bmp, gtk+ will crash:

gdk_property_change: 00030AD4 GDK_SELECTION image/bmp REPLACE 8*0 bits:
... delayed rendering
gdk_selection_send_notify_for_display: 00030AD4 CLIPBOARD image/bmp
GDK_SELECTION (no-op)
_gdk_win32_selection_convert_to_dib: 1252003C image/bmp

Program received signal SIGSEGV, Segmentation fault.
0x749a9f40 in msvcrt!memmove () from C:\Windows\syswow64\msvcrt.dll

Thread 1 (Thread 2248.0x1b34):
target=0xc07b) at gdkselection-win32.c:1292
at gdkevents-win32.c:3498
wparam=8, lparam=0) at gdkevents-win32.c:232
message=773, wparam=8, lparam=0)
    at gdkevents-win32.c:263
C:\Windows\syswow64\user32.dll
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll
wparam=0, lparam=-1687549457)
    at gdkevents-win32.c:248
C:\Users\rugoosse\AppData\Local\virt-viewer\bin\libpangocairo-1.0-0.dll

https://bugzilla.gnome.org/show_bug.cgi?id=728745
2014-04-24 16:07:58 +02:00
a533c83e8d Visual Studio 2010 Projects: Revamp the Projects
As we are likely to have GTK+-2.x around for some time, revamp the Visual
Studio 2010 projects like what was done for rest of the GTK+ stack, namely:

-Split the property sheets, in a way like what was done for the rest of the
 stack.  Also clean up the resulting property sheets a bit, and update the
 projects to use these property sheets.
-Use UNIX line endings for all projects and property sheets, to ease future
 application of patches.
-Make the copying of config.h.win32 and gdkconfig.h.win32 into custom build
 rules, so that they may be removed properly and re-copied during change
 and update.
-Add a PlatformToolset tag, so if we want to support building with Visual
 Studio 2012/2013, the transition can be done quite easily with a script,
 such as what is now being done for the Visual Studio 2012 projects for
 GLib.
2014-04-02 22:05:03 +08:00
8ef1cff3bb Visual Studio 2008 Projects: Revamp the Projects
As we are likely to have GTK+-2.x around for some time, revamp the Visual
Studio 2008 projects like what was done for rest of the GTK+ stack, namely:

-Split the property sheets, in a way like what was done for the rest of the
 stack.  Also clean up the resulting property sheets a bit, and update the
 projects to use these property sheets.
-Use UNIX line endings for all projects and property sheets, to ease future
 application of patches.
-Make the copying of config.h.win32 and gdkconfig.h.win32 into custom build
 rules, so that they may be removed properly and re-copied during change
 and update.

Similar updates will be applied for the Visual Studio 2010 projects ASAP.
2014-04-02 17:57:13 +08:00
1f8d021d30 treeview: properly remove the timeout in expand_collapse_timeout()
or it will later warn about removing a source that doesn't exist.
2014-04-02 00:04:50 +02:00
60189143a4 Print to a file in the current directory by default
When printing to a file, the filename was not being propagated if a
directory was not specified.

https://bugzilla.gnome.org/show_bug.cgi?id=711177
2014-03-18 10:34:21 -05:00
378ea9029f printing: Fail nicely when /tmp is not writable
Don't crash when /tmp is not writable when printing to file.
Show that getting of printer details failed for CUPS printers.

https://bugzilla.gnome.org/show_bug.cgi?id=693200
2014-03-18 16:02:04 +01:00
03014aa9c7 2.24.23 2014-03-17 21:34:01 -04:00
82310d48a8 Bug 634146 - Check g_win32_get_package_installation_directory_of_module() return value
Remaining part of patch from Joshua Element Green.

https://bugzilla.gnome.org/show_bug.cgi?id=634146
2014-03-16 13:59:06 +01:00
95985a2181 win32: free allocated gdi objects in 16bpp
In 16bpp, Gdk is creating hbitmap with CreateDIBSection() and a hdc with
CreateCompatibleDC(). Those 2 objects need to be released when the
pixmap is finalized.

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

Signed-off-by: Hans Breuer <hans@breuer.org>
2014-03-16 13:46:32 +01:00
7ff6e601c3 exstyle changed after the window size adjustment
Originaly the size of the window based on the client area size has
been calculated first and then variables dwStyle and dwExStyle have
been changed. Thus the window size has been calculated for different
windows type then eventually used when calling CreateWindowEx. This
caused for example the Gimp tool windows to have different size than
formerly saved in session. The whole code calculating the window size
is moved after the last adjustment of dwExStyle variable in this patch.

Signed-off-by: Hans Breuer <hans@breuer.org>
2014-03-16 13:46:30 +01:00
6d329406ae Bug 665507 - Pixmap via cairo DIB breaks gdk_gc_set_stipple() use
Only one bitmap can be selected into a device context. Using the
DIB created by cairo consumes the one opportunity, so every further
SelectObject into the same DC in GDK code will fail.
2014-03-16 13:46:29 +01:00