Commit Graph

21534 Commits

Author SHA1 Message Date
Руслан Ижбулатов
88f3b248d6 Revert "W32: Correctly set maximized window position"
This is only needed for CSDs. GKT+-2.x has no CSDs, so this
code is completely unnecessary.

This reverts commit 2fdd8627dd.
2015-03-26 17:11:13 +00:00
Руслан Ижбулатов
2fdd8627dd W32: Correctly set maximized window position
Use screen workarea to *also* set the position of a maximized window,
not just its size. Without this the window position defaults to 0:0
(the topleft corner), which is wrong when taskbar is position along the
top or left edge of the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=746821
2015-03-26 16:09:13 +00:00
Руслан Ижбулатов
d9122d1379 W32: correctly guess max window size from the size of the workarea of the screen it's on
Get monitor on which the most of the window is located (nearest monitor if
window is not on screen), get its work area (area not occupied by taskbar or
any other bars) and use that for maxsize.

Previous default of 30000 meant that windows maximized onto full screen,
even covering the area where taskbar is.

https://bugzilla.gnome.org/show_bug.cgi?id=726592
2015-03-26 16:09:13 +00:00
Matthias Clasen
dd882f5b80 Fix a sporadic segfault in treeview keynav
If a a treeview has frequent periodic additions and removals of
rows, it is possible that a page down keypress moves the cursor
out of the height of the treeview. In some of these cases, we
can be tricked into dereferencing a  NULL pointer.

Bug 612919.

https://bugzilla.gnome.org/show_bug.cgi?id=746269
2015-03-16 12:34:44 -04:00
John Lindgren
ba48b46574 Fix problems with sticky handling (backport of 01320e5773).
Reading a card32 property into a long may lead to undefined high bits, so mask
them off. Also, make the conditions for setting and unsetting the stick flag
opposites, to avoid unintended changes.

https://bugzilla.gnome.org/show_bug.cgi?id=746064
2015-03-12 17:30:39 -04:00
Chun-wei Fan
df09ce5e87 MSVC Builds: Rename "Install" Projects
Rename the install projects as gtk-install, to ease the integration of the
projects in a grand solution that may be used to build, for example, the
entire GTK+ stack.
2015-03-06 16:56:19 +08:00
Chun-wei Fan
bf92167b01 MSVC Builds: "Install" the .pdb Files
"Install" the .pdb files to help people use them to debug the GTK+ stack,
or for their GTK-using applications, as they are already generated for all
builds.

Also update the copying of the DLLs, LIBs and EXEs so that we ensure that
we only copy the items from GTK+-2.x, without accidently copying items that
are not meant to be copied, or make extra copies of items in the wrong
places, such as when the projects here are used in parts of grand solutions
used to build the entire GTK+ stack.
2015-03-06 15:21:52 +08:00
Chun-wei Fan
e129c94171 MSVC 2010+ Builds: Fix .pdb Generation
The .pdb file name must be specified for Visual Studio 2010+ later in order
fo match the output filename if the output filename is different from the
project name.  Update the projects as necessary.
2015-03-06 15:16:39 +08:00
Chun-wei Fan
8995a3e19c MSVC 2010+ Builds: Clean up gtk-install.props
Remove empty lines, they aren't really necessary.
2015-03-06 11:17:39 +08:00
Matthias Clasen
e6333a1a37 2.24.27 2.24.27 2015-03-03 11:40:38 -05:00
Colin Walters
22eb70adab gdkwindow: Fix event unref iteration
We were double looping previously which caused a NULL deref.

(cherry picked from commit d08ff485f2)
2015-03-03 17:13:49 +01:00
Christophe Fergeau
5efefdb655 gdk: Fix GdkWindowFilter internal refcounting
Running gnome-shell under valgrind, I saw the attached invalid write.
Basically we can destroy a window during event processing, and the old
window_remove_filters simply called g_free() on the filter, ignoring
the refcount.  Then later in event processing we call filter->refcount--,
which is writing to free()d memory.

Fix this by centralizing list mutation and refcount handling inside
a new shared _gdk_window_filter_unref() function, and using that
everywhere.

==13876== Invalid write of size 4
==13876==    at 0x446B181: gdk_event_apply_filters (gdkeventsource.c:86)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)
==13876==    by 0x4AB806A: g_main_loop_run (gmain.c:3295)
==13876==    by 0x8084D6B: main (main.c:722)
==13876==  Address 0x1658bcac is 12 bytes inside a block of size 16 free'd
==13876==    at 0x4005EAD: free (vg_replace_malloc.c:366)
==13876==    by 0x4ABE515: g_free (gmem.c:263)
==13876==    by 0x444BCC9: window_remove_filters (gdkwindow.c:1873)
==13876==    by 0x4454BA3: _gdk_window_destroy_hierarchy (gdkwindow.c:2043)
==13876==    by 0x447BF6E: gdk_window_destroy_notify (gdkwindow-x11.c:1115)
==13876==    by 0x43588E2: _gtk_socket_windowing_filter_func (gtksocket-x11.c:518)
==13876==    by 0x446B170: gdk_event_apply_filters (gdkeventsource.c:79)
==13876==    by 0x446B411: _gdk_events_queue (gdkeventsource.c:188)
==13876==    by 0x44437EF: gdk_display_get_event (gdkdisplay.c:410)
==13876==    by 0x446B009: gdk_event_source_dispatch (gdkeventsource.c:317)
==13876==    by 0x4AB7159: g_main_context_dispatch (gmain.c:2436)
==13876==    by 0x4AB7957: g_main_context_iterate.clone.5 (gmain.c:3087)

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

Backport of 806c04411d to
the gtk-2-24 branch. 806c0441 was authored by Colin Walters
<walters@verbum.org>

Without this patch, the spotify linux client was crashing during
playback of some songs when using gtk+ 2.24.26

https://bugzilla.gnome.org/show_bug.cgi?id=745536
2015-03-03 17:13:49 +01:00
Chun-wei Fan
de7ec7a0a9 MSVC 2008 Builds: Speed Up Release Builds
Use the /MP compiler option, where the build time for release builds can
be cut down by quite a bit.  This will however cause a brief warning with
debug builds due to the use of /Gm, but the code will otherwise build
normally.  Unlike the Visual Studio 2010+ builds, we can't use /d2Zi+ as
Visual Studio 2008 does not support that, so we can't get a better
debugging experience for release builds here.
2015-03-03 18:41:59 +08:00
Chun-wei Fan
639845d21e MSVC Builds: Improve Build Speed and Debugging
Use Multiprocessor compilation which can cut down build times by quite a
bit and use the /d2Zi+ flag to have better debugging info being logged to
the .pdb for release builds.

These are only applicable for Visual Studio 2010/2012 and later.
2015-03-03 14:11:18 +08:00
Daniel Drake
c5afe319ad icontheme: allow directories with mtime 0
In order to provide a constant mtime between OS build and deploy time,
while also maintaining a hardlink content-addressed model independent of
timestamps, ostree sets all mtimes to 0.

The icon cache code currently ignores directories with mtime 0, assuming
they don't exist.

Track directory existence in a more precise way.

https://bugzilla.gnome.org/show_bug.cgi?id=745052
2015-02-23 16:51:23 -06:00
Arnav Singh
e01cc5bf5f statusicon: fix crash storing pointer in UINT
https://bugzilla.gnome.org/show_bug.cgi?id=696505
2015-02-21 15:58:41 +01:00
Benjamin Otte
79c05314c6 gdkcairo: Don't leak pixel data
If we fail to attach pixel data to a cairo surface, free it immediately.
We still want to cairo_set_source() the surface to popagate the error.

Spotted by Christian Boxdörfer
2015-02-20 20:52:19 +01:00
Matthias Clasen
eb0e67217e 2.24.26 2.24.26 2015-02-16 13:17:34 -05:00
Matthias Clasen
9169b6aa69 Fix distcheck 2015-02-16 10:31:46 -05:00
Ting-Wei Lan
dea9eae3af Support automake 1.15
https://bugzilla.gnome.org/show_bug.cgi?id=743544
2015-02-16 09:26:18 -05:00
Matthias Clasen
5364ede826 gailbutton: Avoid a possible NULL dereference
We were using widget->window before checking widget for being NULL.

Pointed out by Sami Farin,
https://bugzilla.redhat.com/show_bug.cgi?id=1140414
2015-02-13 13:40:46 -05:00
Matthias Clasen
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
Matthias Clasen
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 323df2b280 to
the gtk-2-24 branch by Wolfgang Ulbrich.
2015-02-13 13:12:39 -05:00
Lars Uebernickel
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
Holin
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
John Ralls
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
Holin
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
John Lindgren
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
Matthias Clasen
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
Matthias Clasen
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
Matthias Clasen
7f99fdbe90 2.24.25 2.24.25 2014-10-10 11:46:36 -04:00
Matthias Clasen
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
Matthias Clasen
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
Jehan
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
Emmanuele Bassi
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
Sebastian Gerhardt
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
Jehan
ab3e3b1834 Makefiles: cross-compilation on Linux for Windows failing.
Missing linking information for some modules.
2014-08-13 20:59:30 +00:00
Matthias Clasen
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
John Ralls
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
Matthias Clasen
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
Michał Górny
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
Andreas Müller
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
Balázs Úr
6a6885c5c0 Updated Hungarian translation 2014-07-08 15:04:53 +00:00
Chun-wei Fan
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
Chun-wei Fan
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
Matthias Clasen
9de65a11bb 2.24.24 2.24.24 2014-06-23 11:08:14 -04:00
Matthias Clasen
72c472287b Include image data in the builtin icon cache 2014-06-23 11:08:14 -04:00
Matthias Clasen
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
Yosef Or Boczko
ff1f1d347d Updated Hebrew translation 2014-06-18 03:07:21 +03:00