Copy F12 work over
This commit is contained in:
parent
04589565f7
commit
530224a762
11
allow-set-hint.patch
Normal file
11
allow-set-hint.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- gtk+-2.18.3/gtk/gtkwindow.c 2009-10-09 01:00:44.000000000 -0400
|
||||
+++ hacked/gtk/gtkwindow.c 2009-10-28 11:45:33.583105288 -0400
|
||||
@@ -2414,7 +2414,7 @@
|
||||
GtkWindowPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
- g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
|
||||
+ g_return_if_fail (!GTK_WIDGET_MAPPED (window));
|
||||
|
||||
priv = GTK_WINDOW_GET_PRIVATE (window);
|
||||
|
@ -1,24 +0,0 @@
|
||||
diff -up gtk+-2.17.7/gtk/gtkiconview.c.appearance-crash gtk+-2.17.7/gtk/gtkiconview.c
|
||||
--- gtk+-2.17.7/gtk/gtkiconview.c.appearance-crash 2009-08-13 10:03:01.717854077 -0400
|
||||
+++ gtk+-2.17.7/gtk/gtkiconview.c 2009-08-13 10:03:31.483855146 -0400
|
||||
@@ -3498,16 +3498,16 @@ gtk_icon_view_get_item_at_coords (GtkIco
|
||||
{
|
||||
if (cell_at_pos)
|
||||
*cell_at_pos = info;
|
||||
-
|
||||
+
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
- if (only_in_cell)
|
||||
- return NULL;
|
||||
-
|
||||
if (cell_at_pos)
|
||||
*cell_at_pos = NULL;
|
||||
+
|
||||
+ if (only_in_cell)
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
return item;
|
271
compose-sequences.patch
Normal file
271
compose-sequences.patch
Normal file
@ -0,0 +1,271 @@
|
||||
From 4eb82ed9624da58cff9dd6c348b12d35967ae3c3 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Thu, 22 Oct 2009 15:25:19 +1000
|
||||
Subject: [PATCH] Update compose sequences
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
gtk/gtkimcontextsimple.c | 2 +-
|
||||
gtk/gtkimcontextsimpleseqs.h | 91 +++++++++++++++++++++++++++--------------
|
||||
2 files changed, 61 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
|
||||
index 62bab7c..f36dcf5 100644
|
||||
--- a/gtk/gtkimcontextsimple.c
|
||||
+++ b/gtk/gtkimcontextsimple.c
|
||||
@@ -61,7 +61,7 @@ struct _GtkComposeTableCompact
|
||||
static const GtkComposeTableCompact gtk_compose_table_compact = {
|
||||
gtk_compose_seqs_compact,
|
||||
5,
|
||||
- 23,
|
||||
+ 24,
|
||||
6
|
||||
};
|
||||
|
||||
diff --git a/gtk/gtkimcontextsimpleseqs.h b/gtk/gtkimcontextsimpleseqs.h
|
||||
index 9e3fc29..131b3db 100644
|
||||
--- a/gtk/gtkimcontextsimpleseqs.h
|
||||
+++ b/gtk/gtkimcontextsimpleseqs.h
|
||||
@@ -18,10 +18,9 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
- * File auto-generated from script found at gtk/compose-parse.py, with the --gtk parameter,
|
||||
+ * File auto-generated from script found at http://bugzilla.gnome.org/show_bug.cgi?id=321896
|
||||
* using the input files
|
||||
* Input : http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=blob_plain;f=nls/en_US.UTF-8/Compose.pre
|
||||
- * Input : http://svn.gnome.org/viewcvs/gtk%2B/trunk/gtk/gtk-compose-lookaside.txt
|
||||
* Input : http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
|
||||
* Input : http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
|
||||
*
|
||||
@@ -68,29 +67,30 @@
|
||||
*/
|
||||
|
||||
static const guint16 gtk_compose_seqs_compact[] = {
|
||||
-GDK_dead_stroke, 138, 226, 235, 235, 235,
|
||||
-GDK_Greek_accentdieresis, 235, 239, 239, 239, 239,
|
||||
-GDK_dead_grave, 239, 299, 386, 598, 598,
|
||||
-GDK_dead_acute, 598, 664, 760, 1036, 1036,
|
||||
-GDK_dead_circumflex, 1036, 1176, 1176, 1376, 1376,
|
||||
-GDK_dead_tilde, 1376, 1458, 1521, 1661, 1661,
|
||||
-GDK_dead_macron, 1661, 1707, 1707, 1779, 1779,
|
||||
-GDK_dead_breve, 1779, 1833, 1833, 1857, 1857,
|
||||
-GDK_dead_abovedot, 1857, 1887, 1890, 1922, 1922,
|
||||
-GDK_dead_diaeresis, 1922, 2010, 2019, 2043, 2043,
|
||||
-GDK_dead_abovering, 2043, 2053, 2053, 2053, 2053,
|
||||
-GDK_dead_doubleacute, 2053, 2063, 2063, 2063, 2063,
|
||||
-GDK_dead_caron, 2063, 2089, 2089, 2097, 2097,
|
||||
-GDK_dead_cedilla, 2097, 2111, 2111, 2111, 2111,
|
||||
-GDK_dead_ogonek, 2111, 2121, 2121, 2121, 2121,
|
||||
-GDK_dead_iota, 2121, 2143, 2242, 2674, 3334,
|
||||
-GDK_dead_voiced_sound, 3334, 3380, 3380, 3380, 3380,
|
||||
-GDK_dead_semivoiced_sound, 3380, 3390, 3390, 3390, 3390,
|
||||
-GDK_dead_belowdot, 3390, 3400, 3400, 3416, 3416,
|
||||
-GDK_dead_hook, 3416, 3494, 3494, 3550, 3550,
|
||||
-GDK_dead_psili, 3550, 3578, 3578, 3578, 3578,
|
||||
-GDK_dead_dasia, 3578, 3610, 3610, 3610, 3610,
|
||||
-GDK_Multi_key, 3610, 3610, 9589, 13297, 15157,
|
||||
+GDK_dead_stroke, 144, 232, 241, 241, 241,
|
||||
+GDK_Greek_accentdieresis, 241, 245, 245, 245, 245,
|
||||
+GDK_dead_grave, 245, 307, 394, 606, 606,
|
||||
+GDK_dead_acute, 606, 674, 770, 1046, 1046,
|
||||
+GDK_dead_circumflex, 1046, 1186, 1186, 1386, 1386,
|
||||
+GDK_dead_tilde, 1386, 1470, 1533, 1673, 1673,
|
||||
+GDK_dead_macron, 1673, 1719, 1719, 1791, 1791,
|
||||
+GDK_dead_breve, 1791, 1845, 1845, 1869, 1869,
|
||||
+GDK_dead_abovedot, 1869, 1899, 1902, 1934, 1934,
|
||||
+GDK_dead_diaeresis, 1934, 2022, 2031, 2055, 2055,
|
||||
+GDK_dead_abovering, 2055, 2065, 2065, 2065, 2065,
|
||||
+GDK_dead_doubleacute, 2065, 2075, 2075, 2075, 2075,
|
||||
+GDK_dead_caron, 2075, 2121, 2121, 2129, 2129,
|
||||
+GDK_dead_cedilla, 2129, 2143, 2143, 2143, 2143,
|
||||
+GDK_dead_ogonek, 2143, 2153, 2153, 2153, 2153,
|
||||
+GDK_dead_iota, 2153, 2175, 2274, 2706, 3366,
|
||||
+GDK_dead_voiced_sound, 3366, 3412, 3412, 3412, 3412,
|
||||
+GDK_dead_semivoiced_sound, 3412, 3422, 3422, 3422, 3422,
|
||||
+GDK_dead_belowdot, 3422, 3438, 3438, 3454, 3454,
|
||||
+GDK_dead_hook, 3454, 3532, 3532, 3588, 3588,
|
||||
+GDK_dead_horn, 3588, 3598, 3598, 3598, 3598,
|
||||
+GDK_dead_psili, 3598, 3626, 3626, 3626, 3626,
|
||||
+GDK_dead_dasia, 3626, 3658, 3658, 3658, 3658,
|
||||
+GDK_Multi_key, 3658, 3658, 9658, 13366, 15231,
|
||||
GDK_space, 0x002F,
|
||||
GDK_2, 0x01BB,
|
||||
GDK_A, 0x023A,
|
||||
@@ -143,6 +143,7 @@ GDK_Greek_upsilon, 0x03B0,
|
||||
GDK_space, 0x0060,
|
||||
GDK_V, 0x01DB,
|
||||
GDK_v, 0x01DC,
|
||||
+GDK_nobreakspace, 0x0300,
|
||||
GDK_Abreve, 0x1EB0,
|
||||
GDK_abreve, 0x1EB1,
|
||||
GDK_Emacron, 0x1E14,
|
||||
@@ -255,6 +256,7 @@ GDK_Multi_key, GDK_macron, GDK_o, 0x1E51,
|
||||
GDK_space, 0x0027,
|
||||
GDK_V, 0x01D7,
|
||||
GDK_v, 0x01D8,
|
||||
+GDK_nobreakspace, 0x0301,
|
||||
GDK_Abreve, 0x1EAE,
|
||||
GDK_abreve, 0x1EAF,
|
||||
GDK_Emacron, 0x1E16,
|
||||
@@ -510,6 +512,7 @@ GDK_space, 0x007E,
|
||||
GDK_less, 0x2272,
|
||||
GDK_equal, 0x2243,
|
||||
GDK_greater, 0x2273,
|
||||
+GDK_nobreakspace, 0x0303,
|
||||
GDK_Oacute, 0x1E4C,
|
||||
GDK_Odiaeresis, 0x1E4E,
|
||||
GDK_Uacute, 0x1E78,
|
||||
@@ -769,6 +772,16 @@ GDK_parenleft, 0x208D,
|
||||
GDK_parenright, 0x208E,
|
||||
GDK_plus, 0x208A,
|
||||
GDK_minus, 0x208B,
|
||||
+GDK_0, 0x2080,
|
||||
+GDK_1, 0x2081,
|
||||
+GDK_2, 0x2082,
|
||||
+GDK_3, 0x2083,
|
||||
+GDK_4, 0x2084,
|
||||
+GDK_5, 0x2085,
|
||||
+GDK_6, 0x2086,
|
||||
+GDK_7, 0x2087,
|
||||
+GDK_8, 0x2088,
|
||||
+GDK_9, 0x2088,
|
||||
GDK_equal, 0x208C,
|
||||
GDK_V, 0x01D9,
|
||||
GDK_v, 0x01DA,
|
||||
@@ -1103,11 +1116,14 @@ GDK_kana_HI, 0x30D4,
|
||||
GDK_kana_FU, 0x30D7,
|
||||
GDK_kana_HE, 0x30DA,
|
||||
GDK_kana_HO, 0x30DD,
|
||||
+GDK_space, 0x0323,
|
||||
GDK_plus, 0x2A25,
|
||||
GDK_minus, 0x2A2A,
|
||||
GDK_equal, 0x2A66,
|
||||
+GDK_nobreakspace, 0x0323,
|
||||
GDK_Abreve, 0x1EB6,
|
||||
GDK_abreve, 0x1EB7,
|
||||
+GDK_dead_belowdot, 0x0323,
|
||||
GDK_Multi_key, GDK_plus, GDK_O, 0x1EE2,
|
||||
GDK_Multi_key, GDK_plus, GDK_U, 0x1EF0,
|
||||
GDK_Multi_key, GDK_plus, GDK_o, 0x1EE3,
|
||||
@@ -1165,6 +1181,11 @@ GDK_Multi_key, GDK_asciicircum, GDK_e, 0x1EC3,
|
||||
GDK_Multi_key, GDK_asciicircum, GDK_o, 0x1ED5,
|
||||
GDK_Multi_key, GDK_b, GDK_A, 0x1EB2,
|
||||
GDK_Multi_key, GDK_b, GDK_a, 0x1EB3,
|
||||
+GDK_space, 0x031B,
|
||||
+GDK_nobreakspace, 0x031B,
|
||||
+GDK_Utilde, 0x1EEE,
|
||||
+GDK_utilde, 0x1EEF,
|
||||
+GDK_dead_horn, 0x031B,
|
||||
GDK_Greek_ALPHA, 0x1F08,
|
||||
GDK_Greek_EPSILON, 0x1F18,
|
||||
GDK_Greek_ETA, 0x1F28,
|
||||
@@ -1368,7 +1389,7 @@ GDK_apostrophe, GDK_Idiaeresis, 0x1E2E,
|
||||
GDK_apostrophe, GDK_Ocircumflex, 0x1ED0,
|
||||
GDK_apostrophe, GDK_Otilde, 0x1E4C,
|
||||
GDK_apostrophe, GDK_Ooblique, 0x01FE,
|
||||
-GDK_apostrophe, 0x00DC, 0x01D7,
|
||||
+GDK_apostrophe, GDK_Udiaeresis, 0x01D7,
|
||||
GDK_apostrophe, GDK_acircumflex, 0x1EA5,
|
||||
GDK_apostrophe, GDK_aring, 0x01FB,
|
||||
GDK_apostrophe, GDK_ae, 0x01FD,
|
||||
@@ -1529,6 +1550,7 @@ GDK_minus, GDK_parenright, 0x007D,
|
||||
GDK_minus, GDK_plus, 0x00B1,
|
||||
GDK_minus, GDK_comma, 0x00AC,
|
||||
GDK_minus, GDK_colon, 0x00F7,
|
||||
+GDK_minus, GDK_greater, 0x2192,
|
||||
GDK_minus, GDK_A, 0x00C3,
|
||||
GDK_minus, GDK_D, 0x0110,
|
||||
GDK_minus, GDK_E, 0x0112,
|
||||
@@ -1603,6 +1625,7 @@ GDK_period, 0x1E62, 0x1E68,
|
||||
GDK_period, 0x1E63, 0x1E69,
|
||||
GDK_slash, GDK_slash, 0x005C,
|
||||
GDK_slash, GDK_less, 0x005C,
|
||||
+GDK_slash, GDK_equal, 0x2260,
|
||||
GDK_slash, GDK_C, 0x00A2,
|
||||
GDK_slash, GDK_D, 0x0110,
|
||||
GDK_slash, GDK_G, 0x01E4,
|
||||
@@ -1682,8 +1705,11 @@ GDK_semicolon, GDK_u, 0x0173,
|
||||
GDK_less, GDK_space, 0x02C7,
|
||||
GDK_less, GDK_quotedbl, 0x201C,
|
||||
GDK_less, GDK_apostrophe, 0x2018,
|
||||
+GDK_less, GDK_minus, 0x2190,
|
||||
GDK_less, GDK_slash, 0x005C,
|
||||
+GDK_less, GDK_3, 0x2665,
|
||||
GDK_less, GDK_less, 0x00AB,
|
||||
+GDK_less, GDK_equal, 0x2264,
|
||||
GDK_less, GDK_C, 0x010C,
|
||||
GDK_less, GDK_D, 0x010E,
|
||||
GDK_less, GDK_E, 0x011A,
|
||||
@@ -1703,6 +1729,7 @@ GDK_less, GDK_s, 0x0161,
|
||||
GDK_less, GDK_t, 0x0165,
|
||||
GDK_less, GDK_z, 0x017E,
|
||||
GDK_less, 0x0338, 0x226E,
|
||||
+GDK_equal, GDK_slash, 0x2260,
|
||||
GDK_equal, GDK_C, 0x20AC,
|
||||
GDK_equal, GDK_E, 0x20AC,
|
||||
GDK_equal, GDK_L, 0x00A3,
|
||||
@@ -1725,6 +1752,7 @@ GDK_equal, GDK_Cyrillic_U, 0x04F2,
|
||||
GDK_greater, GDK_space, 0x005E,
|
||||
GDK_greater, GDK_quotedbl, 0x201D,
|
||||
GDK_greater, GDK_apostrophe, 0x2019,
|
||||
+GDK_greater, GDK_equal, 0x2265,
|
||||
GDK_greater, GDK_greater, 0x00BB,
|
||||
GDK_greater, GDK_A, 0x00C2,
|
||||
GDK_greater, GDK_E, 0x00CA,
|
||||
@@ -2068,7 +2096,7 @@ GDK_underscore, GDK_Adiaeresis, 0x01DE,
|
||||
GDK_underscore, GDK_AE, 0x01E2,
|
||||
GDK_underscore, GDK_Otilde, 0x022C,
|
||||
GDK_underscore, GDK_Odiaeresis, 0x022A,
|
||||
-GDK_underscore, 0x00DC, 0x01D5,
|
||||
+GDK_underscore, GDK_Udiaeresis, 0x01D5,
|
||||
GDK_underscore, GDK_adiaeresis, 0x01DF,
|
||||
GDK_underscore, GDK_ae, 0x01E3,
|
||||
GDK_underscore, GDK_otilde, 0x022D,
|
||||
@@ -2128,7 +2156,7 @@ GDK_grave, GDK_y, 0x1EF3,
|
||||
GDK_grave, GDK_Acircumflex, 0x1EA6,
|
||||
GDK_grave, GDK_Ecircumflex, 0x1EC0,
|
||||
GDK_grave, GDK_Ocircumflex, 0x1ED2,
|
||||
-GDK_grave, 0x00DC, 0x01DB,
|
||||
+GDK_grave, GDK_Udiaeresis, 0x01DB,
|
||||
GDK_grave, GDK_acircumflex, 0x1EA7,
|
||||
GDK_grave, GDK_ecircumflex, 0x1EC1,
|
||||
GDK_grave, GDK_ocircumflex, 0x1ED3,
|
||||
@@ -2279,7 +2307,7 @@ GDK_c, GDK_t, 0x0165,
|
||||
GDK_c, GDK_u, 0x01D4,
|
||||
GDK_c, GDK_z, 0x017E,
|
||||
GDK_c, GDK_bar, 0x00A2,
|
||||
-GDK_c, 0x00DC, 0x01D9,
|
||||
+GDK_c, GDK_Udiaeresis, 0x01D9,
|
||||
GDK_c, GDK_udiaeresis, 0x01DA,
|
||||
GDK_c, 0x01B7, 0x01EE,
|
||||
GDK_c, 0x0292, 0x01EF,
|
||||
@@ -2517,7 +2545,7 @@ GDK_macron, GDK_Adiaeresis, 0x01DE,
|
||||
GDK_macron, GDK_AE, 0x01E2,
|
||||
GDK_macron, GDK_Otilde, 0x022C,
|
||||
GDK_macron, GDK_Odiaeresis, 0x022A,
|
||||
-GDK_macron, 0x00DC, 0x01D5,
|
||||
+GDK_macron, GDK_Udiaeresis, 0x01D5,
|
||||
GDK_macron, GDK_adiaeresis, 0x01DF,
|
||||
GDK_macron, GDK_ae, 0x01E3,
|
||||
GDK_macron, GDK_otilde, 0x022D,
|
||||
@@ -2586,7 +2614,7 @@ GDK_acute, GDK_Idiaeresis, 0x1E2E,
|
||||
GDK_acute, GDK_Ocircumflex, 0x1ED0,
|
||||
GDK_acute, GDK_Otilde, 0x1E4C,
|
||||
GDK_acute, GDK_Ooblique, 0x01FE,
|
||||
-GDK_acute, 0x00DC, 0x01D7,
|
||||
+GDK_acute, GDK_Udiaeresis, 0x01D7,
|
||||
GDK_acute, GDK_acircumflex, 0x1EA5,
|
||||
GDK_acute, GDK_aring, 0x01FB,
|
||||
GDK_acute, GDK_ae, 0x01FD,
|
||||
@@ -4320,6 +4348,7 @@ GDK_parenleft, GDK_KP_4, GDK_KP_7, GDK_parenright, 0x32BC,
|
||||
GDK_parenleft, GDK_KP_4, GDK_KP_8, GDK_parenright, 0x32BD,
|
||||
GDK_parenleft, GDK_KP_4, GDK_KP_9, GDK_parenright, 0x32BE,
|
||||
GDK_parenleft, GDK_KP_5, GDK_KP_0, GDK_parenright, 0x32BF,
|
||||
+GDK_C, GDK_C, GDK_C, GDK_P, 0x262D,
|
||||
GDK_Greek_iota, GDK_apostrophe, GDK_parenleft, GDK_Greek_ALPHA, 0x1F8D,
|
||||
GDK_Greek_iota, GDK_apostrophe, GDK_parenleft, GDK_Greek_ETA, 0x1F9D,
|
||||
GDK_Greek_iota, GDK_apostrophe, GDK_parenleft, GDK_Greek_OMEGA, 0x1FAD,
|
||||
--
|
||||
1.6.5.rc2
|
||||
|
183
csw-fixes.patch
183
csw-fixes.patch
@ -1,183 +0,0 @@
|
||||
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
|
||||
index 869d535..44652bc 100644
|
||||
--- a/gdk/gdkdraw.c
|
||||
+++ b/gdk/gdkdraw.c
|
||||
@@ -752,9 +752,6 @@ gdk_draw_image (GdkDrawable *drawable,
|
||||
* On older X servers, rendering pixbufs with an alpha channel involves round
|
||||
* trips to the X server, and may be somewhat slow.
|
||||
*
|
||||
- * The clip mask of @gc is ignored, but clip rectangles and clip regions work
|
||||
- * fine.
|
||||
- *
|
||||
* If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf
|
||||
* function is accelerated using mediaLib, which provides hardware
|
||||
* acceleration on Intel, AMD, and Sparc chipsets. If desired, mediaLib
|
||||
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
|
||||
index b4c6f81..699cebf 100644
|
||||
--- a/gdk/gdkgc.c
|
||||
+++ b/gdk/gdkgc.c
|
||||
@@ -646,24 +646,49 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
|
||||
GdkPixmap *new_mask;
|
||||
GdkGC *tmp_gc;
|
||||
GdkColor black = {0, 0, 0, 0};
|
||||
+ GdkRectangle r;
|
||||
+ GdkOverlapType overlap;
|
||||
|
||||
- priv->old_clip_mask = g_object_ref (priv->clip_mask);
|
||||
- gdk_drawable_get_size (priv->old_clip_mask, &w, &h);
|
||||
-
|
||||
- new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
|
||||
- tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)new_mask, FALSE);
|
||||
-
|
||||
- gdk_gc_set_foreground (tmp_gc, &black);
|
||||
- gdk_draw_rectangle (new_mask, tmp_gc, TRUE, 0, 0, -1, -1);
|
||||
- _gdk_gc_set_clip_region_internal (tmp_gc, region, TRUE); /* Takes ownership of region */
|
||||
- gdk_draw_drawable (new_mask,
|
||||
- tmp_gc,
|
||||
- priv->old_clip_mask,
|
||||
- 0, 0,
|
||||
- 0, 0,
|
||||
- -1, -1);
|
||||
- gdk_gc_set_clip_region (tmp_gc, NULL);
|
||||
- gdk_gc_set_clip_mask (gc, new_mask);
|
||||
+ gdk_drawable_get_size (priv->clip_mask, &w, &h);
|
||||
+
|
||||
+ r.x = 0;
|
||||
+ r.y = 0;
|
||||
+ r.width = w;
|
||||
+ r.height = h;
|
||||
+
|
||||
+ /* Its quite common to expose areas that are completely in or outside
|
||||
+ * the region, so we try to avoid allocating bitmaps that are just fully
|
||||
+ * set or completely unset.
|
||||
+ */
|
||||
+ overlap = gdk_region_rect_in (region, &r);
|
||||
+ if (overlap == GDK_OVERLAP_RECTANGLE_PART)
|
||||
+ {
|
||||
+ /* The region and the mask intersect, create a new clip mask that
|
||||
+ includes both areas */
|
||||
+ priv->old_clip_mask = g_object_ref (priv->clip_mask);
|
||||
+ new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
|
||||
+ tmp_gc = _gdk_drawable_get_scratch_gc ((GdkDrawable *)new_mask, FALSE);
|
||||
+
|
||||
+ gdk_gc_set_foreground (tmp_gc, &black);
|
||||
+ gdk_draw_rectangle (new_mask, tmp_gc, TRUE, 0, 0, -1, -1);
|
||||
+ _gdk_gc_set_clip_region_internal (tmp_gc, region, TRUE); /* Takes ownership of region */
|
||||
+ gdk_draw_drawable (new_mask,
|
||||
+ tmp_gc,
|
||||
+ priv->old_clip_mask,
|
||||
+ 0, 0,
|
||||
+ 0, 0,
|
||||
+ -1, -1);
|
||||
+ gdk_gc_set_clip_region (tmp_gc, NULL);
|
||||
+ gdk_gc_set_clip_mask (gc, new_mask);
|
||||
+ }
|
||||
+ else if (overlap == GDK_OVERLAP_RECTANGLE_OUT)
|
||||
+ {
|
||||
+ GdkRegion *empty = gdk_region_new ();
|
||||
+
|
||||
+ priv->old_clip_mask = g_object_ref (priv->clip_mask);
|
||||
+ _gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
|
||||
+ gdk_region_destroy (empty);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -775,6 +800,24 @@ _gdk_gc_get_clip_region (GdkGC *gc)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * _gdk_gc_get_clip_mask:
|
||||
+ * @gc: a #GdkGC
|
||||
+ *
|
||||
+ * Gets the current clip mask for @gc, if any.
|
||||
+ *
|
||||
+ * Return value: the clip mask for the GC, or %NULL.
|
||||
+ * (if a clip region is set, the return will be %NULL)
|
||||
+ * This value is owned by the GC and must not be freed.
|
||||
+ **/
|
||||
+GdkBitmap *
|
||||
+_gdk_gc_get_clip_mask (GdkGC *gc)
|
||||
+{
|
||||
+ g_return_val_if_fail (GDK_IS_GC (gc), NULL);
|
||||
+
|
||||
+ return GDK_GC_GET_PRIVATE (gc)->clip_mask;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* _gdk_gc_get_fill:
|
||||
* @gc: a #GdkGC
|
||||
*
|
||||
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
|
||||
index 946c3f9..c984386 100644
|
||||
--- a/gdk/gdkinternals.h
|
||||
+++ b/gdk/gdkinternals.h
|
||||
@@ -399,6 +399,7 @@ void _gdk_gc_init (GdkGC *gc,
|
||||
GdkGCValuesMask values_mask);
|
||||
|
||||
GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
|
||||
+GdkBitmap *_gdk_gc_get_clip_mask (GdkGC *gc);
|
||||
gboolean _gdk_gc_get_exposures (GdkGC *gc);
|
||||
GdkFill _gdk_gc_get_fill (GdkGC *gc);
|
||||
GdkPixmap *_gdk_gc_get_tile (GdkGC *gc);
|
||||
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
|
||||
index 6e72cab..d9b1e5b 100644
|
||||
--- a/gdk/gdkwindow.c
|
||||
+++ b/gdk/gdkwindow.c
|
||||
@@ -639,7 +639,12 @@ remove_child_area (GdkWindowObject *private,
|
||||
child_region = gdk_region_rectangle (&r);
|
||||
|
||||
if (child->shape)
|
||||
- gdk_region_intersect (child_region, child->shape);
|
||||
+ {
|
||||
+ /* Adjust shape region to parent window coords */
|
||||
+ gdk_region_offset (child->shape, child->x, child->y);
|
||||
+ gdk_region_intersect (child_region, child->shape);
|
||||
+ gdk_region_offset (child->shape, -child->x, -child->y);
|
||||
+ }
|
||||
else if (private->window_type == GDK_WINDOW_FOREIGN)
|
||||
{
|
||||
shape = _gdk_windowing_window_get_shape ((GdkWindow *)child);
|
||||
@@ -4660,7 +4665,12 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
|
||||
|
||||
child_region = gdk_region_rectangle (&r);
|
||||
if (child->shape)
|
||||
- gdk_region_intersect (child_region, child->shape);
|
||||
+ {
|
||||
+ /* Adjust shape region to parent window coords */
|
||||
+ gdk_region_offset (child->shape, child->x, child->y);
|
||||
+ gdk_region_intersect (child_region, child->shape);
|
||||
+ gdk_region_offset (child->shape, -child->x, -child->y);
|
||||
+ }
|
||||
|
||||
if (child->impl == private->impl)
|
||||
{
|
||||
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
|
||||
index 537a47e..b2cac29 100644
|
||||
--- a/gdk/x11/gdkdrawable-x11.c
|
||||
+++ b/gdk/x11/gdkdrawable-x11.c
|
||||
@@ -388,9 +388,22 @@ gdk_x11_drawable_update_picture_clip (GdkDrawable *drawable,
|
||||
else
|
||||
{
|
||||
XRenderPictureAttributes pa;
|
||||
- pa.clip_mask = None;
|
||||
+ GdkBitmap *mask;
|
||||
+ gulong pa_mask;
|
||||
+
|
||||
+ pa_mask = CPClipMask;
|
||||
+ if (gc && (mask = _gdk_gc_get_clip_mask (gc)))
|
||||
+ {
|
||||
+ pa.clip_mask = GDK_PIXMAP_XID (mask);
|
||||
+ pa.clip_x_origin = gc->clip_x_origin;
|
||||
+ pa.clip_y_origin = gc->clip_y_origin;
|
||||
+ pa_mask |= CPClipXOrigin | CPClipYOrigin;
|
||||
+ }
|
||||
+ else
|
||||
+ pa.clip_mask = None;
|
||||
+
|
||||
XRenderChangePicture (xdisplay, picture,
|
||||
- CPClipMask, &pa);
|
||||
+ pa_mask, &pa);
|
||||
}
|
||||
}
|
||||
|
@ -1,150 +0,0 @@
|
||||
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
|
||||
index 555418a..2a84a48 100644
|
||||
--- a/gtk/gtkcombobox.c
|
||||
+++ b/gtk/gtkcombobox.c
|
||||
@@ -1695,7 +1695,7 @@ cell_view_is_sensitive (GtkCellView *cell_view)
|
||||
GList *cells, *list;
|
||||
gboolean sensitive;
|
||||
|
||||
- cells = gtk_cell_view_get_cell_renderers (cell_view);
|
||||
+ cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_view));
|
||||
|
||||
sensitive = FALSE;
|
||||
for (list = cells; list; list = list->next)
|
||||
@@ -1732,7 +1732,7 @@ tree_column_row_is_sensitive (GtkComboBox *combo_box,
|
||||
priv->model,
|
||||
iter, FALSE, FALSE);
|
||||
|
||||
- cells = gtk_tree_view_column_get_cell_renderers (priv->column);
|
||||
+ cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->column));
|
||||
|
||||
sensitive = FALSE;
|
||||
for (list = cells; list; list = list->next)
|
||||
@@ -4097,7 +4097,7 @@ gtk_combo_box_list_select_func (GtkTreeSelection *selection,
|
||||
gtk_tree_view_column_cell_set_cell_data (column, model, &iter,
|
||||
FALSE, FALSE);
|
||||
|
||||
- cell = cells = gtk_tree_view_column_get_cell_renderers (column);
|
||||
+ cell = cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
|
||||
while (cell)
|
||||
{
|
||||
g_object_get (cell->data,
|
||||
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
|
||||
index e2e0142..a3a01be 100644
|
||||
--- a/gtk/gtkentrycompletion.c
|
||||
+++ b/gtk/gtkentrycompletion.c
|
||||
@@ -758,7 +758,7 @@ gtk_entry_completion_get_cells (GtkCellLayout *cell_layout)
|
||||
|
||||
priv = GTK_ENTRY_COMPLETION_GET_PRIVATE (cell_layout);
|
||||
|
||||
- return gtk_tree_view_column_get_cell_renderers (priv->column);
|
||||
+ return gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->column));
|
||||
}
|
||||
|
||||
/* all those callbacks */
|
||||
@@ -1486,7 +1486,7 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
completion->priv->ignore_enter = TRUE;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (column);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
|
||||
gtk_widget_ensure_style (completion->priv->tree_view);
|
||||
g_object_set (GTK_CELL_RENDERER (renderers->data), "cell-background-gdk",
|
||||
&completion->priv->tree_view->style->bg[GTK_STATE_NORMAL],
|
||||
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
|
||||
index 22836c1..7dc9867 100644
|
||||
--- a/gtk/gtkfilechooserdefault.c
|
||||
+++ b/gtk/gtkfilechooserdefault.c
|
||||
@@ -3707,7 +3707,7 @@ rename_selected_bookmark (GtkFileChooserDefault *impl)
|
||||
{
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL (impl->shortcuts_model), &iter);
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view), 0);
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (column);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
|
||||
cell = g_list_nth_data (renderers, 1);
|
||||
g_list_free (renderers);
|
||||
g_object_set (cell, "editable", TRUE, NULL);
|
||||
diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c
|
||||
index 3dbf40d..224660d 100644
|
||||
--- a/gtk/tests/builder.c
|
||||
+++ b/gtk/tests/builder.c
|
||||
@@ -1147,7 +1147,7 @@ test_treeview_column (void)
|
||||
g_assert (GTK_IS_TREE_VIEW_COLUMN (column));
|
||||
g_assert (strcmp (gtk_tree_view_column_get_title (column), "Test") == 0);
|
||||
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (column);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
|
||||
g_assert (g_list_length (renderers) == 1);
|
||||
renderer = g_list_nth_data (renderers, 0);
|
||||
g_assert (renderer);
|
||||
@@ -1423,7 +1423,7 @@ test_cell_view (void)
|
||||
path = gtk_tree_path_new_first ();
|
||||
gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (cellview), path);
|
||||
|
||||
- renderers = gtk_cell_view_get_cell_renderers (GTK_CELL_VIEW (cellview));
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cellview));
|
||||
g_assert (renderers);
|
||||
g_assert (g_list_length (renderers) == 1);
|
||||
|
||||
diff --git a/gtk/tests/treeview-scrolling.c b/gtk/tests/treeview-scrolling.c
|
||||
index 5ee24c1..0207dbc 100644
|
||||
--- a/gtk/tests/treeview-scrolling.c
|
||||
+++ b/gtk/tests/treeview-scrolling.c
|
||||
@@ -728,7 +728,7 @@ scroll_new_row (ScrollFixture *fixture,
|
||||
|
||||
/* Set up a signal handler to acquire the editable widget */
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (fixture->tree_view), 0);
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (column);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
|
||||
|
||||
g_signal_connect (G_OBJECT (renderers->data), "editing-started",
|
||||
G_CALLBACK (scroll_new_row_editing_started),
|
||||
diff --git a/modules/other/gail/gailtreeview.c b/modules/other/gail/gailtreeview.c
|
||||
index d615a45..d305ae0 100644
|
||||
--- a/modules/other/gail/gailtreeview.c
|
||||
+++ b/modules/other/gail/gailtreeview.c
|
||||
@@ -867,7 +867,7 @@ gail_tree_view_ref_child (AtkObject *obj,
|
||||
gtk_tree_view_column_cell_set_cell_data (tv_col, tree_model, &iter,
|
||||
is_expander, is_expanded);
|
||||
|
||||
- renderer_list = gtk_tree_view_column_get_cell_renderers (tv_col);
|
||||
+ renderer_list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
|
||||
|
||||
/* If there are more than one renderer in the list, make a container */
|
||||
|
||||
@@ -2127,7 +2127,7 @@ gail_tree_view_get_cell_area (GailCellParent *parent,
|
||||
GtkCellRenderer *renderer;
|
||||
|
||||
cell_index = atk_object_get_index_in_parent (ATK_OBJECT (cell));
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (tv_col);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
|
||||
renderer = g_list_nth_data (renderers, cell_index);
|
||||
|
||||
found = gtk_tree_view_column_cell_get_position (tv_col, renderer, &cell_start, &cell_width);
|
||||
@@ -2180,7 +2180,7 @@ gail_tree_view_grab_cell_focus (GailCellParent *parent,
|
||||
*/
|
||||
GList *renderers;
|
||||
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (tv_col);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
|
||||
if (cell_info->in_use) {
|
||||
index = atk_object_get_index_in_parent (cell_object);
|
||||
renderer = g_list_nth_data (renderers, index);
|
||||
@@ -3177,7 +3177,7 @@ update_cell_value (GailRendererCell *renderer_cell,
|
||||
gtk_tree_view_column_cell_set_cell_data (cell_info->cell_col_ref,
|
||||
tree_model, &iter, is_expander, is_expanded);
|
||||
}
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (cell_info->cell_col_ref);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
|
||||
gail_return_val_if_fail (renderers, FALSE);
|
||||
|
||||
/*
|
||||
@@ -4001,7 +4001,7 @@ toggle_cell_toggled (GailCell *cell)
|
||||
gail_return_if_fail (path);
|
||||
pathstring = gtk_tree_path_to_string (path);
|
||||
|
||||
- renderers = gtk_tree_view_column_get_cell_renderers (cell_info->cell_col_ref);
|
||||
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
|
||||
gail_return_if_fail (renderers);
|
||||
|
||||
/*
|
@ -1,13 +0,0 @@
|
||||
diff --git a/gtk/gtkentrybuffer.h b/gtk/gtkentrybuffer.h
|
||||
index cf2ddda..275aaa1 100644
|
||||
--- a/gtk/gtkentrybuffer.h
|
||||
+++ b/gtk/gtkentrybuffer.h
|
||||
@@ -17,7 +17,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
@ -1,94 +0,0 @@
|
||||
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
|
||||
index 319b8ce..8c5d419 100644
|
||||
--- a/gtk/gtktextlayout.c
|
||||
+++ b/gtk/gtktextlayout.c
|
||||
@@ -1812,56 +1812,59 @@ allocate_child_widgets (GtkTextLayout *text_layout,
|
||||
{
|
||||
PangoLayout *layout = display->layout;
|
||||
PangoLayoutIter *run_iter;
|
||||
-
|
||||
+
|
||||
run_iter = pango_layout_get_iter (layout);
|
||||
-
|
||||
do
|
||||
{
|
||||
PangoLayoutRun *run = pango_layout_iter_get_run_readonly (run_iter);
|
||||
-
|
||||
+
|
||||
if (run && is_shape (run))
|
||||
{
|
||||
gint byte_index;
|
||||
GtkTextIter text_iter;
|
||||
- GtkTextChildAnchor *anchor = 0;
|
||||
- GList *widgets = 0;
|
||||
-
|
||||
- /* The pango iterator iterates in visual order.
|
||||
+ GtkTextChildAnchor *anchor = NULL;
|
||||
+ GList *widgets = NULL;
|
||||
+ GList *l;
|
||||
+
|
||||
+ /* The pango iterator iterates in visual order.
|
||||
* We use the byte index to find the child widget.
|
||||
*/
|
||||
-
|
||||
byte_index = pango_layout_iter_get_index (run_iter);
|
||||
line_display_index_to_iter (text_layout, display, &text_iter, byte_index, 0);
|
||||
anchor = gtk_text_iter_get_child_anchor (&text_iter);
|
||||
- widgets = gtk_text_child_anchor_get_widgets (anchor);
|
||||
-
|
||||
- if (widgets)
|
||||
+ if (anchor)
|
||||
+ widgets = gtk_text_child_anchor_get_widgets (anchor);
|
||||
+
|
||||
+ for (l = widgets; l; l = l->next)
|
||||
{
|
||||
PangoRectangle extents;
|
||||
- GtkWidget *child = widgets->data;
|
||||
+ GtkWidget *child = l->data;
|
||||
|
||||
- /* We emit "allocate_child" with the x,y of
|
||||
- * the widget with respect to the top of the line
|
||||
- * and the left side of the buffer
|
||||
- */
|
||||
-
|
||||
- pango_layout_iter_get_run_extents (run_iter,
|
||||
- NULL,
|
||||
- &extents);
|
||||
-
|
||||
- g_signal_emit (text_layout,
|
||||
- signals[ALLOCATE_CHILD],
|
||||
- 0,
|
||||
- child,
|
||||
- PANGO_PIXELS (extents.x) + display->x_offset,
|
||||
- PANGO_PIXELS (extents.y) + display->top_margin);
|
||||
-
|
||||
- g_list_free (widgets);
|
||||
+ if (_gtk_anchored_child_get_layout (child) == text_layout)
|
||||
+ {
|
||||
+
|
||||
+ /* We emit "allocate_child" with the x,y of
|
||||
+ * the widget with respect to the top of the line
|
||||
+ * and the left side of the buffer
|
||||
+ */
|
||||
+ pango_layout_iter_get_run_extents (run_iter,
|
||||
+ NULL,
|
||||
+ &extents);
|
||||
+
|
||||
+ g_signal_emit (text_layout,
|
||||
+ signals[ALLOCATE_CHILD],
|
||||
+ 0,
|
||||
+ child,
|
||||
+ PANGO_PIXELS (extents.x) + display->x_offset,
|
||||
+ PANGO_PIXELS (extents.y) + display->top_margin);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ g_list_free (widgets);
|
||||
}
|
||||
}
|
||||
while (pango_layout_iter_next_run (run_iter));
|
||||
-
|
||||
+
|
||||
pango_layout_iter_free (run_iter);
|
||||
}
|
||||
|
374
fresh-tooltips.patch
Normal file
374
fresh-tooltips.patch
Normal file
@ -0,0 +1,374 @@
|
||||
diff -up gtk+-2.18.3/gtk/gtktooltip.c.fresh-tooltips gtk+-2.18.3/gtk/gtktooltip.c
|
||||
--- gtk+-2.18.3/gtk/gtktooltip.c.fresh-tooltips 2009-10-16 10:35:45.000000000 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtktooltip.c 2009-10-31 14:53:37.120183113 -0400
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "gtkhbox.h"
|
||||
#include "gtkalignment.h"
|
||||
|
||||
+#ifdef GDK_WINDOWING_X11
|
||||
+#include "gdk/x11/gdkx.h"
|
||||
+#endif
|
||||
+
|
||||
#include "gtkalias.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -95,6 +99,7 @@ static void gtk_tooltip_display_cl
|
||||
GtkTooltip *tooltip);
|
||||
static void gtk_tooltip_set_last_window (GtkTooltip *tooltip,
|
||||
GdkWindow *window);
|
||||
+static void update_shape (GtkTooltip *tooltip);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkTooltip, gtk_tooltip, G_TYPE_OBJECT);
|
||||
@@ -110,8 +115,43 @@ gtk_tooltip_class_init (GtkTooltipClass
|
||||
}
|
||||
|
||||
static void
|
||||
+on_composited_changed (GtkWidget *window,
|
||||
+ GtkTooltip *tooltip)
|
||||
+{
|
||||
+ update_shape (tooltip);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_screen_changed (GtkWidget *window,
|
||||
+ GdkScreen *previous,
|
||||
+ GtkTooltip *tooltip)
|
||||
+{
|
||||
+ GdkScreen *screen;
|
||||
+ GdkColormap *cmap;
|
||||
+
|
||||
+ screen = gtk_widget_get_screen (window);
|
||||
+
|
||||
+ cmap = NULL;
|
||||
+ if (gdk_screen_is_composited (screen))
|
||||
+ cmap = gdk_screen_get_rgba_colormap (screen);
|
||||
+ if (cmap == NULL)
|
||||
+ cmap = gdk_screen_get_rgb_colormap (screen);
|
||||
+
|
||||
+ gtk_widget_set_colormap (window, cmap);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_realized (GtkWidget *window,
|
||||
+ GtkTooltip *tooltip)
|
||||
+{
|
||||
+ update_shape (tooltip);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
gtk_tooltip_init (GtkTooltip *tooltip)
|
||||
{
|
||||
+ GdkScreen *screen;
|
||||
+
|
||||
tooltip->timeout_id = 0;
|
||||
tooltip->browse_mode_timeout_id = 0;
|
||||
|
||||
@@ -127,8 +167,12 @@ gtk_tooltip_init (GtkTooltip *tooltip)
|
||||
tooltip->last_window = NULL;
|
||||
|
||||
tooltip->window = g_object_ref (gtk_window_new (GTK_WINDOW_POPUP));
|
||||
+
|
||||
+ on_screen_changed (tooltip->window, NULL, tooltip);
|
||||
+
|
||||
gtk_window_set_type_hint (GTK_WINDOW (tooltip->window),
|
||||
GDK_WINDOW_TYPE_HINT_TOOLTIP);
|
||||
+
|
||||
gtk_widget_set_app_paintable (tooltip->window, TRUE);
|
||||
gtk_window_set_resizable (GTK_WINDOW (tooltip->window), FALSE);
|
||||
gtk_widget_set_name (tooltip->window, "gtk-tooltip");
|
||||
@@ -145,7 +189,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
|
||||
gtk_widget_show (tooltip->alignment);
|
||||
|
||||
g_signal_connect_swapped (tooltip->window, "style-set",
|
||||
- G_CALLBACK (gtk_tooltip_window_style_set), tooltip);
|
||||
+ G_CALLBACK (gtk_tooltip_window_style_set), tooltip);
|
||||
g_signal_connect_swapped (tooltip->window, "expose-event",
|
||||
G_CALLBACK (gtk_tooltip_paint_window), tooltip);
|
||||
|
||||
@@ -162,6 +206,13 @@ gtk_tooltip_init (GtkTooltip *tooltip)
|
||||
gtk_box_pack_start (GTK_BOX (tooltip->box), tooltip->label,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
+ g_signal_connect (tooltip->window, "composited-changed",
|
||||
+ G_CALLBACK (on_composited_changed), tooltip);
|
||||
+ g_signal_connect (tooltip->window, "screen-changed",
|
||||
+ G_CALLBACK (on_screen_changed), tooltip);
|
||||
+ g_signal_connect (tooltip->window, "realize",
|
||||
+ G_CALLBACK (on_realized), tooltip);
|
||||
+
|
||||
tooltip->custom_widget = NULL;
|
||||
}
|
||||
|
||||
@@ -318,9 +369,9 @@ gtk_tooltip_set_icon_from_stock (GtkTool
|
||||
* Since: 2.14
|
||||
*/
|
||||
void
|
||||
-gtk_tooltip_set_icon_from_icon_name(GtkTooltip *tooltip,
|
||||
- const gchar *icon_name,
|
||||
- GtkIconSize size)
|
||||
+gtk_tooltip_set_icon_from_icon_name (GtkTooltip *tooltip,
|
||||
+ const gchar *icon_name,
|
||||
+ GtkIconSize size)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
|
||||
|
||||
@@ -471,27 +522,217 @@ static void
|
||||
gtk_tooltip_window_style_set (GtkTooltip *tooltip)
|
||||
{
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (tooltip->alignment),
|
||||
- tooltip->window->style->ythickness,
|
||||
- tooltip->window->style->ythickness,
|
||||
- tooltip->window->style->xthickness,
|
||||
+ tooltip->window->style->ythickness,
|
||||
+ tooltip->window->style->ythickness,
|
||||
+ tooltip->window->style->xthickness,
|
||||
tooltip->window->style->xthickness);
|
||||
-
|
||||
+ gtk_box_set_spacing (GTK_BOX (tooltip->box),
|
||||
+ tooltip->window->style->xthickness);
|
||||
gtk_widget_queue_draw (tooltip->window);
|
||||
}
|
||||
|
||||
+static void
|
||||
+draw_round_rect (cairo_t *cr,
|
||||
+ gdouble aspect,
|
||||
+ gdouble x,
|
||||
+ gdouble y,
|
||||
+ gdouble corner_radius,
|
||||
+ gdouble width,
|
||||
+ gdouble height)
|
||||
+{
|
||||
+ gdouble radius = corner_radius / aspect;
|
||||
+
|
||||
+ cairo_move_to (cr, x + radius, y);
|
||||
+
|
||||
+ /* top-right, left of the corner */
|
||||
+ cairo_line_to (cr, x + width - radius, y);
|
||||
+
|
||||
+ /* top-right, below the corner */
|
||||
+ cairo_arc (cr,
|
||||
+ x + width - radius, y + radius, radius,
|
||||
+ -90.0f * G_PI / 180.0f, 0.0f * G_PI / 180.0f);
|
||||
+
|
||||
+ /* bottom-right, above the corner */
|
||||
+ cairo_line_to (cr, x + width, y + height - radius);
|
||||
+
|
||||
+ /* bottom-right, left of the corner */
|
||||
+ cairo_arc (cr,
|
||||
+ x + width - radius, y + height - radius, radius,
|
||||
+ 0.0f * G_PI / 180.0f, 90.0f * G_PI / 180.0f);
|
||||
+
|
||||
+ /* bottom-left, right of the corner */
|
||||
+ cairo_line_to (cr, x + radius, y + height);
|
||||
+
|
||||
+ /* bottom-left, above the corner */
|
||||
+ cairo_arc (cr,
|
||||
+ x + radius, y + height - radius, radius,
|
||||
+ 90.0f * G_PI / 180.0f, 180.0f * G_PI / 180.0f);
|
||||
+
|
||||
+ /* top-left, below the corner */
|
||||
+ cairo_line_to (cr, x, y + radius);
|
||||
+
|
||||
+ /* top-left, right of the corner */
|
||||
+ cairo_arc (cr,
|
||||
+ x + radius, y + radius, radius,
|
||||
+ 180.0f * G_PI / 180.0f, 270.0f * G_PI / 180.0f);
|
||||
+
|
||||
+ cairo_close_path (cr);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+fill_background (GtkWidget *widget,
|
||||
+ cairo_t *cr)
|
||||
+{
|
||||
+ GdkColor color;
|
||||
+ gdouble r, g, b;
|
||||
+ gint radius;
|
||||
+ gdouble background_alpha;
|
||||
+
|
||||
+ if (gdk_screen_is_composited (gtk_widget_get_screen (widget)))
|
||||
+ background_alpha = 0.90;
|
||||
+ else
|
||||
+ background_alpha = 1.0;
|
||||
+
|
||||
+ radius = MIN (widget->style->xthickness, widget->style->ythickness);
|
||||
+ radius = MAX (radius, 1);
|
||||
+
|
||||
+ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
|
||||
+ cairo_paint (cr);
|
||||
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
+
|
||||
+ draw_round_rect (cr,
|
||||
+ 1.0, 0.5, 0.5, radius,
|
||||
+ widget->allocation.width - 1,
|
||||
+ widget->allocation.height - 1);
|
||||
+
|
||||
+ color = widget->style->bg [GTK_STATE_NORMAL];
|
||||
+ r = (float)color.red / 65535.0;
|
||||
+ g = (float)color.green / 65535.0;
|
||||
+ b = (float)color.blue / 65535.0;
|
||||
+ cairo_set_source_rgba (cr, r, g, b, background_alpha);
|
||||
+ cairo_fill_preserve (cr);
|
||||
+
|
||||
+ color = widget->style->bg [GTK_STATE_SELECTED];
|
||||
+ r = (float) color.red / 65535.0;
|
||||
+ g = (float) color.green / 65535.0;
|
||||
+ b = (float) color.blue / 65535.0;
|
||||
+
|
||||
+ cairo_set_source_rgba (cr, r, g, b, background_alpha);
|
||||
+ cairo_set_line_width (cr, 1.0);
|
||||
+ cairo_stroke (cr);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+update_shape (GtkTooltip *tooltip)
|
||||
+{
|
||||
+ GdkScreen *screen;
|
||||
+ GdkBitmap *mask;
|
||||
+ cairo_t *cr;
|
||||
+ gint width, height;
|
||||
+ gboolean new_style;
|
||||
+ gint radius;
|
||||
+
|
||||
+ gtk_widget_style_get (tooltip->window, "new-tooltip-style", &new_style, NULL);
|
||||
+
|
||||
+ if (!new_style)
|
||||
+ {
|
||||
+ gtk_widget_shape_combine_mask (tooltip->window, NULL, 0, 0);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ screen = gtk_widget_get_screen (tooltip->window);
|
||||
+
|
||||
+ gtk_window_get_size (GTK_WINDOW (tooltip->window), &width, &height);
|
||||
+
|
||||
+ if (gdk_screen_is_composited (screen))
|
||||
+ {
|
||||
+ GdkRectangle rect;
|
||||
+ GdkRegion *region;
|
||||
+ const char *wm;
|
||||
+
|
||||
+ gtk_widget_shape_combine_mask (tooltip->window, NULL, 0, 0);
|
||||
+#ifdef GDK_WINDOWING_X11
|
||||
+ /* This is a hack to keep the Metacity compositor from slapping a
|
||||
+ * non-shaped shadow around the shaped tooltip
|
||||
+ */
|
||||
+ if (!GTK_WIDGET_MAPPED (tooltip->window))
|
||||
+ {
|
||||
+ wm = gdk_x11_screen_get_window_manager_name (screen);
|
||||
+ if (g_strcmp0 (wm, "Metacity") == 0)
|
||||
+ gtk_window_set_type_hint (GTK_WINDOW (tooltip->window),
|
||||
+ GDK_WINDOW_TYPE_HINT_DND);
|
||||
+ }
|
||||
+#endif
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ radius = MIN (tooltip->window->style->xthickness,
|
||||
+ tooltip->window->style->ythickness);
|
||||
+ radius = MAX (radius, 1);
|
||||
+ mask = (GdkBitmap *) gdk_pixmap_new (NULL, width, height, 1);
|
||||
+ cr = gdk_cairo_create (mask);
|
||||
+ if (cairo_status (cr) == CAIRO_STATUS_SUCCESS)
|
||||
+ {
|
||||
+ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
|
||||
+ cairo_paint (cr);
|
||||
+
|
||||
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
|
||||
+ draw_round_rect (cr, 1.0, 0, 0, radius + 1, width, height);
|
||||
+ cairo_fill (cr);
|
||||
+
|
||||
+ gtk_widget_shape_combine_mask (tooltip->window, mask, 0, 0);
|
||||
+ }
|
||||
+ cairo_destroy (cr);
|
||||
+
|
||||
+ g_object_unref (mask);
|
||||
+}
|
||||
+
|
||||
static gboolean
|
||||
gtk_tooltip_paint_window (GtkTooltip *tooltip)
|
||||
{
|
||||
- gtk_paint_flat_box (tooltip->window->style,
|
||||
- tooltip->window->window,
|
||||
- GTK_STATE_NORMAL,
|
||||
- GTK_SHADOW_OUT,
|
||||
- NULL,
|
||||
- tooltip->window,
|
||||
- "tooltip",
|
||||
- 0, 0,
|
||||
- tooltip->window->allocation.width,
|
||||
- tooltip->window->allocation.height);
|
||||
+ gboolean new_style;
|
||||
+
|
||||
+ gtk_widget_style_get (tooltip->window, "new-tooltip-style", &new_style, NULL);
|
||||
+
|
||||
+ if (new_style)
|
||||
+ {
|
||||
+ cairo_t *context;
|
||||
+ cairo_surface_t *surface;
|
||||
+ cairo_t *cr;
|
||||
+
|
||||
+ context = gdk_cairo_create (tooltip->window->window);
|
||||
+
|
||||
+ cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
|
||||
+ surface = cairo_surface_create_similar (cairo_get_target (context),
|
||||
+ CAIRO_CONTENT_COLOR_ALPHA,
|
||||
+ tooltip->window->allocation.width,
|
||||
+ tooltip->window->allocation.height);
|
||||
+ cr = cairo_create (surface);
|
||||
+
|
||||
+ fill_background (tooltip->window, cr);
|
||||
+
|
||||
+ cairo_destroy (cr);
|
||||
+ cairo_set_source_surface (context, surface, 0, 0);
|
||||
+ cairo_paint (context);
|
||||
+ cairo_surface_destroy (surface);
|
||||
+ cairo_destroy (context);
|
||||
+
|
||||
+ update_shape (tooltip);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gtk_paint_flat_box (tooltip->window->style,
|
||||
+ tooltip->window->window,
|
||||
+ GTK_STATE_NORMAL,
|
||||
+ GTK_SHADOW_OUT,
|
||||
+ NULL,
|
||||
+ tooltip->window,
|
||||
+ "tooltip",
|
||||
+ 0, 0,
|
||||
+ tooltip->window->allocation.width,
|
||||
+ tooltip->window->allocation.height);
|
||||
+ }
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -631,7 +872,7 @@ find_widget_under_pointer (GdkWindow *wi
|
||||
|
||||
#ifdef DEBUG_TOOLTIP
|
||||
g_print ("event window %p (belonging to %p (%s)) (%d, %d)\n",
|
||||
- window, event_widget, gtk_widget_get_name (event_widget),
|
||||
+ gindow, event_widget, gtk_widget_get_name (event_widget),
|
||||
*x, *y);
|
||||
#endif
|
||||
|
||||
diff -up gtk+-2.18.3/gtk/gtkwidget.c.fresh-tooltips gtk+-2.18.3/gtk/gtkwidget.c
|
||||
--- gtk+-2.18.3/gtk/gtkwidget.c.fresh-tooltips 2009-10-09 01:00:44.000000000 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtkwidget.c 2009-10-31 14:27:50.333957199 -0400
|
||||
@@ -2386,6 +2386,14 @@ gtk_widget_class_init (GtkWidgetClass *k
|
||||
P_("The length of vertical scroll arrows"),
|
||||
1, G_MAXINT, 16,
|
||||
GTK_PARAM_READABLE));
|
||||
+
|
||||
+ gtk_widget_class_install_style_property (klass,
|
||||
+ g_param_spec_boolean ("new-tooltip-style",
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ FALSE,
|
||||
+ GTK_PARAM_READABLE));
|
||||
+
|
||||
}
|
||||
|
||||
static void
|
@ -1,30 +0,0 @@
|
||||
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
|
||||
index 7a000aa..ec36191 100644
|
||||
--- a/gdk/gdkwindow.c
|
||||
+++ b/gdk/gdkwindow.c
|
||||
@@ -5049,7 +5049,7 @@ gdk_window_invalidate_rect (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
- if (private->input_only || !private->viewable)
|
||||
+ if (private->input_only || !private->viewable || !GDK_WINDOW_IS_MAPPED (window))
|
||||
return;
|
||||
|
||||
if (!rect)
|
||||
@@ -5135,6 +5135,7 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
|
||||
|
||||
if (private->input_only ||
|
||||
!private->viewable ||
|
||||
+ !GDK_WINDOW_IS_MAPPED (window) ||
|
||||
gdk_region_empty (region))
|
||||
return;
|
||||
|
||||
@@ -7929,7 +7930,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
|
||||
if (base_y_offset)
|
||||
*base_y_offset = 0;
|
||||
|
||||
- if (!private->viewable || private->input_only)
|
||||
+ if (!private->viewable || !GDK_WINDOW_IS_MAPPED (window) || private->input_only)
|
||||
return gdk_region_new ();
|
||||
|
||||
window_get_size_rectangle (window, &visible_rect);
|
@ -1,12 +0,0 @@
|
||||
diff -up gtk+-2.17.11/gdk/x11/gdkdisplay-x11.c.bell gtk+-2.17.11/gdk/x11/gdkdisplay-x11.c
|
||||
--- gtk+-2.17.11/gdk/x11/gdkdisplay-x11.c.bell 2009-09-13 23:20:20.540275068 -0400
|
||||
+++ gtk+-2.17.11/gdk/x11/gdkdisplay-x11.c 2009-09-13 23:20:39.649290396 -0400
|
||||
@@ -691,7 +691,7 @@ gdk_display_beep (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
- XBell (GDK_DISPLAY_XDISPLAY (display), 0);
|
||||
+ XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
|
||||
}
|
||||
|
||||
/**
|
@ -1,24 +0,0 @@
|
||||
diff -up gtk+-2.17.11/po/Makefile.in.in.fix-install gtk+-2.17.11/po/Makefile.in.in
|
||||
--- gtk+-2.17.11/po/Makefile.in.in.fix-install 2009-09-05 01:19:45.303824009 -0400
|
||||
+++ gtk+-2.17.11/po/Makefile.in.in 2009-09-05 01:19:14.632573806 -0400
|
||||
@@ -126,7 +126,7 @@ install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(mkdir_p) $(DESTDIR)$(datadir); \
|
||||
- @catalogs='$(CATALOGS)'; \
|
||||
+ catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
diff -up gtk+-2.17.11/po-properties/Makefile.in.in.fix-install gtk+-2.17.11/po-properties/Makefile.in.in
|
||||
--- gtk+-2.17.11/po-properties/Makefile.in.in.fix-install 2009-09-05 01:19:54.543583934 -0400
|
||||
+++ gtk+-2.17.11/po-properties/Makefile.in.in 2009-09-05 01:20:16.427830666 -0400
|
||||
@@ -107,7 +107,7 @@ install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(mkdir_p) $(DESTDIR)$(datadir); \
|
||||
- @catalogs='$(CATALOGS)'; \
|
||||
+ catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
@ -1,212 +0,0 @@
|
||||
diff -up gtk+-2.18.0/gtk/gtkprintunixdialog.c.printing-nonblocking-printer-list gtk+-2.18.0/gtk/gtkprintunixdialog.c
|
||||
--- gtk+-2.18.0/gtk/gtkprintunixdialog.c.printing-nonblocking-printer-list 2009-09-11 22:58:38.000000000 -0400
|
||||
+++ gtk+-2.18.0/gtk/gtkprintunixdialog.c 2009-09-23 01:28:27.595033076 -0400
|
||||
@@ -596,7 +596,7 @@ gtk_print_unix_dialog_destroy (GtkPrintU
|
||||
}
|
||||
|
||||
static void
|
||||
-disconnect_printer_details_request (GtkPrintUnixDialog *dialog)
|
||||
+disconnect_printer_details_request (GtkPrintUnixDialog *dialog, gboolean details_failed)
|
||||
{
|
||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||
|
||||
@@ -606,12 +606,20 @@ disconnect_printer_details_request (GtkP
|
||||
priv->request_details_tag);
|
||||
priv->request_details_tag = 0;
|
||||
set_busy_cursor (dialog, FALSE);
|
||||
- gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
|
||||
- g_object_get_data (G_OBJECT (priv->request_details_printer),
|
||||
- "gtk-print-tree-iter"),
|
||||
- PRINTER_LIST_COL_STATE,
|
||||
- gtk_printer_get_state_message (priv->request_details_printer),
|
||||
- -1);
|
||||
+ if (details_failed)
|
||||
+ gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
|
||||
+ g_object_get_data (G_OBJECT (priv->request_details_printer),
|
||||
+ "gtk-print-tree-iter"),
|
||||
+ PRINTER_LIST_COL_STATE,
|
||||
+ _("Getting printer information failed"),
|
||||
+ -1);
|
||||
+ else
|
||||
+ gtk_list_store_set (GTK_LIST_STORE (priv->printer_list),
|
||||
+ g_object_get_data (G_OBJECT (priv->request_details_printer),
|
||||
+ "gtk-print-tree-iter"),
|
||||
+ PRINTER_LIST_COL_STATE,
|
||||
+ gtk_printer_get_state_message (priv->request_details_printer),
|
||||
+ -1);
|
||||
g_object_unref (priv->request_details_printer);
|
||||
priv->request_details_printer = NULL;
|
||||
}
|
||||
@@ -626,7 +634,7 @@ gtk_print_unix_dialog_finalize (GObject
|
||||
GList *node;
|
||||
|
||||
unschedule_idle_mark_conflicts (dialog);
|
||||
- disconnect_printer_details_request (dialog);
|
||||
+ disconnect_printer_details_request (dialog, FALSE);
|
||||
|
||||
if (priv->current_printer)
|
||||
{
|
||||
@@ -1781,7 +1789,7 @@ printer_details_acquired (GtkPrinter
|
||||
{
|
||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||
|
||||
- disconnect_printer_details_request (dialog);
|
||||
+ disconnect_printer_details_request (dialog, !success);
|
||||
|
||||
if (success)
|
||||
{
|
||||
@@ -1809,7 +1817,7 @@ selected_printer_changed (GtkTreeSelecti
|
||||
priv->waiting_for_printer = NULL;
|
||||
}
|
||||
|
||||
- disconnect_printer_details_request (dialog);
|
||||
+ disconnect_printer_details_request (dialog, FALSE);
|
||||
|
||||
printer = NULL;
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &filter_iter))
|
||||
diff -up gtk+-2.18.0/modules/printbackends/cups/gtkprintbackendcups.c.printing-nonblocking-printer-list gtk+-2.18.0/modules/printbackends/cups/gtkprintbackendcups.c
|
||||
--- gtk+-2.18.0/modules/printbackends/cups/gtkprintbackendcups.c.printing-nonblocking-printer-list 2009-09-23 01:28:27.557052405 -0400
|
||||
+++ gtk+-2.18.0/modules/printbackends/cups/gtkprintbackendcups.c 2009-09-23 01:28:27.600060112 -0400
|
||||
@@ -156,7 +156,7 @@ static GList * cups_printer
|
||||
static GtkPageSetup * cups_printer_get_default_page_size (GtkPrinter *printer);
|
||||
static void cups_printer_request_details (GtkPrinter *printer);
|
||||
static gboolean cups_request_default_printer (GtkPrintBackendCups *print_backend);
|
||||
-static void cups_request_ppd (GtkPrinter *printer);
|
||||
+static gboolean cups_request_ppd (GtkPrinter *printer);
|
||||
static void cups_printer_get_hard_margins (GtkPrinter *printer,
|
||||
double *top,
|
||||
double *bottom,
|
||||
@@ -1906,6 +1906,8 @@ cups_request_printer_list_cb (GtkPrintBa
|
||||
else
|
||||
g_object_ref (printer);
|
||||
|
||||
+ GTK_PRINTER_CUPS (printer)->remote = remote_printer;
|
||||
+
|
||||
gtk_printer_set_is_paused (printer, is_paused);
|
||||
gtk_printer_set_is_accepting_jobs (printer, is_accepting_jobs);
|
||||
|
||||
@@ -2206,7 +2208,7 @@ done:
|
||||
GDK_THREADS_LEAVE ();
|
||||
}
|
||||
|
||||
-static void
|
||||
+static gboolean
|
||||
cups_request_ppd (GtkPrinter *printer)
|
||||
{
|
||||
GError *error;
|
||||
@@ -2226,6 +2228,26 @@ cups_request_ppd (GtkPrinter *printer)
|
||||
GTK_NOTE (PRINTING,
|
||||
g_print ("CUPS Backend: %s\n", G_STRFUNC));
|
||||
|
||||
+ if (cups_printer->remote)
|
||||
+ {
|
||||
+ GtkCupsConnectionState state;
|
||||
+
|
||||
+ state = gtk_cups_connection_test_get_state (cups_printer->remote_cups_connection_test);
|
||||
+
|
||||
+ if (state == GTK_CUPS_CONNECTION_IN_PROGRESS)
|
||||
+ return TRUE;
|
||||
+
|
||||
+ gtk_cups_connection_test_free (cups_printer->remote_cups_connection_test);
|
||||
+ cups_printer->remote_cups_connection_test = NULL;
|
||||
+ cups_printer->get_remote_ppd_poll = 0;
|
||||
+
|
||||
+ if (state == GTK_CUPS_CONNECTION_NOT_AVAILABLE)
|
||||
+ {
|
||||
+ g_signal_emit_by_name (printer, "details-acquired", FALSE);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
http = httpConnectEncrypt (cups_printer->hostname,
|
||||
cups_printer->port,
|
||||
cupsEncryption ());
|
||||
@@ -2255,7 +2277,7 @@ cups_request_ppd (GtkPrinter *printer)
|
||||
g_free (data);
|
||||
|
||||
g_signal_emit_by_name (printer, "details-acquired", FALSE);
|
||||
- return;
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
data->http = http;
|
||||
@@ -2293,6 +2315,8 @@ cups_request_ppd (GtkPrinter *printer)
|
||||
|
||||
g_free (resource);
|
||||
g_free (ppd_filename);
|
||||
+
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
/* Ordering matters for default preference */
|
||||
@@ -2590,7 +2614,22 @@ cups_printer_request_details (GtkPrinter
|
||||
cups_printer = GTK_PRINTER_CUPS (printer);
|
||||
if (!cups_printer->reading_ppd &&
|
||||
gtk_printer_cups_get_ppd (cups_printer) == NULL)
|
||||
- cups_request_ppd (printer);
|
||||
+ {
|
||||
+ if (cups_printer->remote)
|
||||
+ {
|
||||
+ if (cups_printer->get_remote_ppd_poll == 0)
|
||||
+ {
|
||||
+ cups_printer->remote_cups_connection_test = gtk_cups_connection_test_new (cups_printer->hostname);
|
||||
+
|
||||
+ if (cups_request_ppd (printer))
|
||||
+ cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (200,
|
||||
+ (GSourceFunc) cups_request_ppd,
|
||||
+ printer);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ cups_request_ppd (printer);
|
||||
+ }
|
||||
}
|
||||
|
||||
static char *
|
||||
diff -up gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.c.printing-nonblocking-printer-list gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.c
|
||||
--- gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.c.printing-nonblocking-printer-list 2009-09-23 01:28:27.558041288 -0400
|
||||
+++ gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.c 2009-09-23 01:30:55.841053044 -0400
|
||||
@@ -78,6 +78,9 @@ gtk_printer_cups_init (GtkPrinterCups *p
|
||||
printer->default_cover_before = NULL;
|
||||
printer->default_cover_after = NULL;
|
||||
printer->auth_info_required = NULL;
|
||||
+ printer->remote = FALSE;
|
||||
+ printer->get_remote_ppd_poll = 0;
|
||||
+ printer->remote_cups_connection_test = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -100,6 +103,11 @@ gtk_printer_cups_finalize (GObject *obje
|
||||
if (printer->ppd_file)
|
||||
ppdClose (printer->ppd_file);
|
||||
|
||||
+ if (printer->get_remote_ppd_poll > 0)
|
||||
+ g_source_remove (printer->get_remote_ppd_poll);
|
||||
+
|
||||
+ gtk_cups_connection_test_free (printer->remote_cups_connection_test);
|
||||
+
|
||||
G_OBJECT_CLASS (gtk_printer_cups_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
diff -up gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.h.printing-nonblocking-printer-list gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.h
|
||||
--- gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.h.printing-nonblocking-printer-list 2009-09-23 01:28:27.559041206 -0400
|
||||
+++ gtk+-2.18.0/modules/printbackends/cups/gtkprintercups.h 2009-09-23 01:31:02.087036708 -0400
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <glib-object.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/ppd.h>
|
||||
+#include "gtkcupsutils.h"
|
||||
|
||||
#include <gtk/gtkunixprint.h>
|
||||
|
||||
@@ -56,6 +57,10 @@ struct _GtkPrinterCups
|
||||
|
||||
gchar *default_cover_before;
|
||||
gchar *default_cover_after;
|
||||
+
|
||||
+ gboolean remote;
|
||||
+ guint get_remote_ppd_poll;
|
||||
+ GtkCupsConnectionTest *remote_cups_connection_test;
|
||||
};
|
||||
|
||||
struct _GtkPrinterCupsClass
|
@ -1,770 +0,0 @@
|
||||
From 82562ae5ddd7e50428aaedb5eb1edeec57c3f54f Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Wed, 16 Sep 2009 14:54:05 +0200
|
||||
Subject: [PATCH] Add support for 'auth-info' attribute to the CUPS backend
|
||||
|
||||
Check for 'auth-info-required' attribute from printer attributes to
|
||||
find out whether an authentization of user is needed.
|
||||
Change password dialog of print backend to be able to require informations
|
||||
requested thru 'auth-info-required' (#566522).
|
||||
---
|
||||
gtk/gtkmarshalers.list | 1 +
|
||||
gtk/gtkprintbackend.c | 164 +++++++-------
|
||||
gtk/gtkprintbackend.h | 16 +-
|
||||
modules/printbackends/cups/gtkcupsutils.c | 5 +
|
||||
modules/printbackends/cups/gtkcupsutils.h | 3 +
|
||||
modules/printbackends/cups/gtkprintbackendcups.c | 255 ++++++++++++++++++++--
|
||||
modules/printbackends/cups/gtkprintercups.c | 2 +
|
||||
modules/printbackends/cups/gtkprintercups.h | 1 +
|
||||
8 files changed, 339 insertions(+), 108 deletions(-)
|
||||
|
||||
diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list
|
||||
index 533a266..77873cb 100644
|
||||
--- a/gtk/gtkmarshalers.list
|
||||
+++ b/gtk/gtkmarshalers.list
|
||||
@@ -111,3 +111,4 @@ VOID:UINT,STRING,UINT
|
||||
VOID:UINT,UINT
|
||||
VOID:VOID
|
||||
OBJECT:OBJECT,INT,INT
|
||||
+VOID:POINTER,POINTER,POINTER,POINTER,STRING
|
||||
diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c
|
||||
index 567273b..3c64823 100644
|
||||
--- a/gtk/gtkprintbackend.c
|
||||
+++ b/gtk/gtkprintbackend.c
|
||||
@@ -50,9 +50,8 @@ struct _GtkPrintBackendPrivate
|
||||
guint printer_list_requested : 1;
|
||||
guint printer_list_done : 1;
|
||||
GtkPrintBackendStatus status;
|
||||
- char *hostname;
|
||||
- char *username;
|
||||
- char *password;
|
||||
+ char **auth_info_required;
|
||||
+ char **auth_info;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -359,8 +358,10 @@ static GList * fallback_printer_list_papers (GtkPrinter
|
||||
static GtkPageSetup * fallback_printer_get_default_page_size (GtkPrinter *printer);
|
||||
static GtkPrintCapabilities fallback_printer_get_capabilities (GtkPrinter *printer);
|
||||
static void request_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
+ gpointer auth_info_required,
|
||||
+ gpointer auth_info_default,
|
||||
+ gpointer auth_info_display,
|
||||
+ gpointer auth_info_visible,
|
||||
const gchar *prompt);
|
||||
|
||||
static void
|
||||
@@ -441,8 +442,8 @@ gtk_print_backend_class_init (GtkPrintBackendClass *class)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GtkPrintBackendClass, request_password),
|
||||
NULL, NULL,
|
||||
- _gtk_marshal_VOID__STRING_STRING_STRING,
|
||||
- G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
|
||||
+ _gtk_marshal_VOID__POINTER_POINTER_POINTER_POINTER_STRING,
|
||||
+ G_TYPE_NONE, 5, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_STRING);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -455,9 +456,8 @@ gtk_print_backend_init (GtkPrintBackend *backend)
|
||||
priv->printers = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) g_object_unref);
|
||||
- priv->hostname = NULL;
|
||||
- priv->username = NULL;
|
||||
- priv->password = NULL;
|
||||
+ priv->auth_info_required = NULL;
|
||||
+ priv->auth_info = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -662,40 +662,29 @@ gtk_print_backend_print_stream (GtkPrintBackend *backend,
|
||||
}
|
||||
|
||||
void
|
||||
-gtk_print_backend_set_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *password)
|
||||
+gtk_print_backend_set_password (GtkPrintBackend *backend,
|
||||
+ gchar **auth_info_required,
|
||||
+ gchar **auth_info)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_PRINT_BACKEND (backend));
|
||||
|
||||
if (GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password)
|
||||
- GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password (backend, hostname, username, password);
|
||||
+ GTK_PRINT_BACKEND_GET_CLASS (backend)->set_password (backend, auth_info_required, auth_info);
|
||||
}
|
||||
|
||||
static void
|
||||
-store_password (GtkEntry *entry,
|
||||
- GtkPrintBackend *backend)
|
||||
+store_entry (GtkEntry *entry,
|
||||
+ gpointer user_data)
|
||||
{
|
||||
- GtkPrintBackendPrivate *priv = backend->priv;
|
||||
+ gchar **data = (gchar **) user_data;
|
||||
|
||||
- if (priv->password != NULL)
|
||||
+ if (*data != NULL)
|
||||
{
|
||||
- memset (priv->password, 0, strlen (priv->password));
|
||||
- g_free (priv->password);
|
||||
+ memset (*data, 0, strlen (*data));
|
||||
+ g_free (*data);
|
||||
}
|
||||
|
||||
- priv->password = g_strdup (gtk_entry_get_text (entry));
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-store_username (GtkEntry *entry,
|
||||
- GtkPrintBackend *backend)
|
||||
-{
|
||||
- GtkPrintBackendPrivate *priv = backend->priv;
|
||||
-
|
||||
- g_free (priv->username);
|
||||
- priv->username = g_strdup (gtk_entry_get_text (entry));
|
||||
+ *data = g_strdup (gtk_entry_get_text (entry));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -704,21 +693,24 @@ password_dialog_response (GtkWidget *dialog,
|
||||
GtkPrintBackend *backend)
|
||||
{
|
||||
GtkPrintBackendPrivate *priv = backend->priv;
|
||||
+ gint i;
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
- gtk_print_backend_set_password (backend, priv->hostname, priv->username, priv->password);
|
||||
+ gtk_print_backend_set_password (backend, priv->auth_info_required, priv->auth_info);
|
||||
else
|
||||
- gtk_print_backend_set_password (backend, priv->hostname, priv->username, NULL);
|
||||
+ gtk_print_backend_set_password (backend, priv->auth_info_required, NULL);
|
||||
|
||||
- if (priv->password != NULL)
|
||||
- {
|
||||
- memset (priv->password, 0, strlen (priv->password));
|
||||
- g_free (priv->password);
|
||||
- priv->password = NULL;
|
||||
- }
|
||||
+ for (i = 0; i < g_strv_length (priv->auth_info_required); i++)
|
||||
+ if (priv->auth_info[i] != NULL)
|
||||
+ {
|
||||
+ memset (priv->auth_info[i], 0, strlen (priv->auth_info[i]));
|
||||
+ g_free (priv->auth_info[i]);
|
||||
+ priv->auth_info[i] = NULL;
|
||||
+ }
|
||||
+ g_free (priv->auth_info);
|
||||
+ priv->auth_info = NULL;
|
||||
|
||||
- g_free (priv->username);
|
||||
- priv->username = NULL;
|
||||
+ g_strfreev (priv->auth_info_required);
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
@@ -726,16 +718,27 @@ password_dialog_response (GtkWidget *dialog,
|
||||
}
|
||||
|
||||
static void
|
||||
-request_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *prompt)
|
||||
+request_password (GtkPrintBackend *backend,
|
||||
+ gpointer auth_info_required,
|
||||
+ gpointer auth_info_default,
|
||||
+ gpointer auth_info_display,
|
||||
+ gpointer auth_info_visible,
|
||||
+ const gchar *prompt)
|
||||
{
|
||||
GtkPrintBackendPrivate *priv = backend->priv;
|
||||
- GtkWidget *dialog, *username_box, *password_box, *main_box, *label, *icon, *vbox,
|
||||
- *password_prompt, *username_prompt,
|
||||
- *password_entry, *username_entry;
|
||||
+ GtkWidget *dialog, *box, *main_box, *label, *icon, *vbox, *entry;
|
||||
+ GtkWidget *focus = NULL;
|
||||
gchar *markup;
|
||||
+ gint length;
|
||||
+ gint i;
|
||||
+ gchar **ai_required = (gchar **) auth_info_required;
|
||||
+ gchar **ai_default = (gchar **) auth_info_default;
|
||||
+ gchar **ai_display = (gchar **) auth_info_display;
|
||||
+ gboolean *ai_visible = (gboolean *) auth_info_visible;
|
||||
+
|
||||
+ priv->auth_info_required = g_strdupv (ai_required);
|
||||
+ length = g_strv_length (ai_required);
|
||||
+ priv->auth_info = g_new0 (gchar *, length);
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ( _("Authentication"), NULL, GTK_DIALOG_MODAL,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
@@ -766,27 +769,6 @@ request_password (GtkPrintBackend *backend,
|
||||
g_free (markup);
|
||||
|
||||
|
||||
- /* Right - 2. */
|
||||
- username_box = gtk_hbox_new (TRUE, 0);
|
||||
-
|
||||
- username_prompt = gtk_label_new (_("Username:"));
|
||||
- gtk_misc_set_alignment (GTK_MISC (username_prompt), 0.0, 0.5);
|
||||
-
|
||||
- username_entry = gtk_entry_new ();
|
||||
- gtk_entry_set_text (GTK_ENTRY (username_entry), username);
|
||||
-
|
||||
-
|
||||
- /* Right - 3. */
|
||||
- password_box = gtk_hbox_new (TRUE, 0);
|
||||
-
|
||||
- password_prompt = gtk_label_new (_("Password:"));
|
||||
- gtk_misc_set_alignment (GTK_MISC (password_prompt), 0.0, 0.5);
|
||||
-
|
||||
- password_entry = gtk_entry_new ();
|
||||
- gtk_entry_set_visibility (GTK_ENTRY (password_entry), FALSE);
|
||||
- gtk_entry_set_activates_default (GTK_ENTRY (password_entry), TRUE);
|
||||
-
|
||||
-
|
||||
/* Packing */
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_box, TRUE, FALSE, 0);
|
||||
|
||||
@@ -794,26 +776,42 @@ request_password (GtkPrintBackend *backend,
|
||||
gtk_box_pack_start (GTK_BOX (main_box), vbox, FALSE, FALSE, 6);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 6);
|
||||
- gtk_box_pack_start (GTK_BOX (vbox), username_box, FALSE, TRUE, 6);
|
||||
- gtk_box_pack_start (GTK_BOX (vbox), password_box, FALSE, TRUE, 6);
|
||||
+
|
||||
+ /* Right - 2. */
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ {
|
||||
+ priv->auth_info[i] = g_strdup (ai_default[i]);
|
||||
+ if (ai_display[i] != NULL)
|
||||
+ {
|
||||
+ box = gtk_hbox_new (TRUE, 0);
|
||||
+
|
||||
+ label = gtk_label_new (ai_display[i]);
|
||||
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
|
||||
- gtk_box_pack_start (GTK_BOX (username_box), username_prompt, TRUE, TRUE, 0);
|
||||
- gtk_box_pack_start (GTK_BOX (username_box), username_entry, TRUE, TRUE, 0);
|
||||
+ entry = gtk_entry_new ();
|
||||
+ focus = entry;
|
||||
|
||||
- gtk_box_pack_start (GTK_BOX (password_box), password_prompt, TRUE, TRUE, 0);
|
||||
- gtk_box_pack_start (GTK_BOX (password_box), password_entry, TRUE, TRUE, 0);
|
||||
+ if (ai_default[i] != NULL)
|
||||
+ gtk_entry_set_text (GTK_ENTRY (entry), ai_default[i]);
|
||||
|
||||
+ gtk_entry_set_visibility (GTK_ENTRY (entry), ai_visible[i]);
|
||||
+ gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
|
||||
|
||||
- gtk_widget_grab_focus (password_entry);
|
||||
+ gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, TRUE, 6);
|
||||
|
||||
- priv->hostname = g_strdup (hostname);
|
||||
- priv->username = g_strdup (username);
|
||||
+ gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
|
||||
+ gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0);
|
||||
|
||||
- g_signal_connect (password_entry, "changed",
|
||||
- G_CALLBACK (store_password), backend);
|
||||
+ g_signal_connect (entry, "changed",
|
||||
+ G_CALLBACK (store_entry), &(priv->auth_info[i]));
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- g_signal_connect (username_entry, "changed",
|
||||
- G_CALLBACK (store_username), backend);
|
||||
+ if (focus != NULL)
|
||||
+ {
|
||||
+ gtk_widget_grab_focus (focus);
|
||||
+ focus = NULL;
|
||||
+ }
|
||||
|
||||
g_object_ref (backend);
|
||||
g_signal_connect (G_OBJECT (dialog), "response",
|
||||
diff --git a/gtk/gtkprintbackend.h b/gtk/gtkprintbackend.h
|
||||
index 7d75f8e..c4b43b1 100644
|
||||
--- a/gtk/gtkprintbackend.h
|
||||
+++ b/gtk/gtkprintbackend.h
|
||||
@@ -121,15 +121,16 @@ struct _GtkPrintBackendClass
|
||||
void (*printer_status_changed) (GtkPrintBackend *backend,
|
||||
GtkPrinter *printer);
|
||||
void (*request_password) (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
+ gpointer auth_info_required,
|
||||
+ gpointer auth_info_default,
|
||||
+ gpointer auth_info_display,
|
||||
+ gpointer auth_info_visible,
|
||||
const gchar *prompt);
|
||||
|
||||
/* not a signal */
|
||||
void (*set_password) (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *password);
|
||||
+ gchar **auth_info_required,
|
||||
+ gchar **auth_info);
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved1) (void);
|
||||
@@ -153,9 +154,8 @@ void gtk_print_backend_print_stream (GtkPrintBackend *pri
|
||||
GList * gtk_print_backend_load_modules (void);
|
||||
void gtk_print_backend_destroy (GtkPrintBackend *print_backend);
|
||||
void gtk_print_backend_set_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *password);
|
||||
+ gchar **auth_info_required,
|
||||
+ gchar **auth_info);
|
||||
|
||||
/* Backend-only functions for GtkPrintBackend */
|
||||
|
||||
diff --git a/modules/printbackends/cups/gtkcupsutils.c b/modules/printbackends/cups/gtkcupsutils.c
|
||||
index bcd03dc..cd97f10 100644
|
||||
--- a/modules/printbackends/cups/gtkcupsutils.c
|
||||
+++ b/modules/printbackends/cups/gtkcupsutils.c
|
||||
@@ -187,6 +187,10 @@ gtk_cups_request_new_with_username (http_t *connection,
|
||||
"requesting-user-name",
|
||||
NULL, cupsUser ());
|
||||
|
||||
+ request->auth_info_required = NULL;
|
||||
+ request->auth_info = NULL;
|
||||
+ request->need_auth_info = FALSE;
|
||||
+
|
||||
cupsLangFree (language);
|
||||
|
||||
return request;
|
||||
@@ -241,6 +245,7 @@ gtk_cups_request_free (GtkCupsRequest *request)
|
||||
}
|
||||
|
||||
g_free (request->username);
|
||||
+ g_strfreev (request->auth_info_required);
|
||||
|
||||
gtk_cups_result_free (request->result);
|
||||
|
||||
diff --git a/modules/printbackends/cups/gtkcupsutils.h b/modules/printbackends/cups/gtkcupsutils.h
|
||||
index 47fd106..ba43f87 100644
|
||||
--- a/modules/printbackends/cups/gtkcupsutils.h
|
||||
+++ b/modules/printbackends/cups/gtkcupsutils.h
|
||||
@@ -99,6 +99,9 @@ struct _GtkCupsRequest
|
||||
|
||||
gint own_http : 1;
|
||||
gint need_password : 1;
|
||||
+ gint need_auth_info : 1;
|
||||
+ gchar **auth_info_required;
|
||||
+ gchar **auth_info;
|
||||
GtkCupsPasswordState password_state;
|
||||
};
|
||||
|
||||
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
|
||||
index 92d4b9b..b715817 100644
|
||||
--- a/modules/printbackends/cups/gtkprintbackendcups.c
|
||||
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
|
||||
@@ -94,6 +94,8 @@ typedef struct
|
||||
GtkCupsRequest *request;
|
||||
GPollFD *data_poll;
|
||||
GtkPrintBackendCups *backend;
|
||||
+ GtkPrintCupsResponseCallbackFunc callback;
|
||||
+ gpointer callback_data;
|
||||
|
||||
} GtkPrintCupsDispatchWatch;
|
||||
|
||||
@@ -179,13 +181,13 @@ static cairo_surface_t * cups_printer_create_cairo_surface (GtkPrinter
|
||||
gdouble height,
|
||||
GIOChannel *cache_io);
|
||||
|
||||
-static void gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *password);
|
||||
+static void gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
|
||||
+ gchar **auth_info_required,
|
||||
+ gchar **auth_info);
|
||||
|
||||
-void overwrite_and_free (gpointer data);
|
||||
-static gboolean is_address_local (const gchar *address);
|
||||
+void overwrite_and_free (gpointer data);
|
||||
+static gboolean is_address_local (const gchar *address);
|
||||
+static gboolean request_auth_info (gpointer data);
|
||||
|
||||
static void
|
||||
gtk_print_backend_cups_register_type (GTypeModule *module)
|
||||
@@ -557,6 +559,9 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend,
|
||||
ps->dnotify = dnotify;
|
||||
ps->job = g_object_ref (job);
|
||||
|
||||
+ request->need_auth_info = cups_printer->auth_info_required != NULL;
|
||||
+ request->auth_info_required = g_strdupv (cups_printer->auth_info_required);
|
||||
+
|
||||
cups_request_execute (GTK_PRINT_BACKEND_CUPS (print_backend),
|
||||
request,
|
||||
(GtkPrintCupsResponseCallbackFunc) cups_print_cb,
|
||||
@@ -656,18 +661,38 @@ is_address_local (const gchar *address)
|
||||
}
|
||||
|
||||
static void
|
||||
-gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
|
||||
- const gchar *hostname,
|
||||
- const gchar *username,
|
||||
- const gchar *password)
|
||||
+gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
|
||||
+ gchar **auth_info_required,
|
||||
+ gchar **auth_info)
|
||||
{
|
||||
GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (backend);
|
||||
GList *l;
|
||||
char dispatch_hostname[HTTP_MAX_URI];
|
||||
gchar *key;
|
||||
+ gchar *username = NULL;
|
||||
+ gchar *hostname = NULL;
|
||||
+ gchar *password = NULL;
|
||||
+ gint length;
|
||||
+ gint i;
|
||||
|
||||
- key = g_strconcat (username, "@", hostname, NULL);
|
||||
- g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
|
||||
+ length = g_strv_length (auth_info_required);
|
||||
+
|
||||
+ if (auth_info != NULL)
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ {
|
||||
+ if (g_strcmp0 (auth_info_required[i], "username") == 0)
|
||||
+ username = g_strdup (auth_info[i]);
|
||||
+ else if (g_strcmp0 (auth_info_required[i], "hostname") == 0)
|
||||
+ hostname = g_strdup (auth_info[i]);
|
||||
+ else if (g_strcmp0 (auth_info_required[i], "password") == 0)
|
||||
+ password = g_strdup (auth_info[i]);
|
||||
+ }
|
||||
+
|
||||
+ if (hostname != NULL && username != NULL && password != NULL)
|
||||
+ {
|
||||
+ key = g_strconcat (username, "@", hostname, NULL);
|
||||
+ g_hash_table_insert (cups_backend->auth, key, g_strdup (password));
|
||||
+ }
|
||||
|
||||
g_free (cups_backend->username);
|
||||
cups_backend->username = g_strdup (username);
|
||||
@@ -683,7 +708,18 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend,
|
||||
if (is_address_local (dispatch_hostname))
|
||||
strcpy (dispatch_hostname, "localhost");
|
||||
|
||||
- if (strcmp (hostname, dispatch_hostname) == 0)
|
||||
+ if (dispatch->request->need_auth_info)
|
||||
+ {
|
||||
+ if (auth_info != NULL)
|
||||
+ {
|
||||
+ dispatch->request->auth_info = g_new0 (gchar *, length + 1);
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ dispatch->request->auth_info[i] = g_strdup (auth_info[i]);
|
||||
+ }
|
||||
+ dispatch->backend->authentication_lock = FALSE;
|
||||
+ dispatch->request->need_auth_info = FALSE;
|
||||
+ }
|
||||
+ else if (dispatch->request->password_state == GTK_CUPS_PASSWORD_REQUESTED || auth_info == NULL)
|
||||
{
|
||||
overwrite_and_free (dispatch->request->password);
|
||||
dispatch->request->password = g_strdup (password);
|
||||
@@ -704,6 +740,12 @@ request_password (gpointer data)
|
||||
gchar *prompt = NULL;
|
||||
gchar *key = NULL;
|
||||
char hostname[HTTP_MAX_URI];
|
||||
+ gchar **auth_info_required;
|
||||
+ gchar **auth_info_default;
|
||||
+ gchar **auth_info_display;
|
||||
+ gboolean *auth_info_visible;
|
||||
+ gint length = 3;
|
||||
+ gint i;
|
||||
|
||||
if (dispatch->backend->authentication_lock)
|
||||
return FALSE;
|
||||
@@ -717,6 +759,22 @@ request_password (gpointer data)
|
||||
else
|
||||
username = cupsUser ();
|
||||
|
||||
+ auth_info_required = g_new0 (gchar*, length + 1);
|
||||
+ auth_info_required[0] = g_strdup ("hostname");
|
||||
+ auth_info_required[1] = g_strdup ("username");
|
||||
+ auth_info_required[2] = g_strdup ("password");
|
||||
+
|
||||
+ auth_info_default = g_new0 (gchar*, length + 1);
|
||||
+ auth_info_default[0] = g_strdup (hostname);
|
||||
+ auth_info_default[1] = g_strdup (username);
|
||||
+
|
||||
+ auth_info_display = g_new0 (gchar*, length + 1);
|
||||
+ auth_info_display[1] = g_strdup (_("Username:"));
|
||||
+ auth_info_display[2] = g_strdup (_("Password:"));
|
||||
+
|
||||
+ auth_info_visible = g_new0 (gboolean, length + 1);
|
||||
+ auth_info_visible[1] = TRUE;
|
||||
+
|
||||
key = g_strconcat (username, "@", hostname, NULL);
|
||||
password = g_hash_table_lookup (dispatch->backend->auth, key);
|
||||
|
||||
@@ -784,11 +842,22 @@ request_password (gpointer data)
|
||||
g_free (printer_name);
|
||||
|
||||
g_signal_emit_by_name (dispatch->backend, "request-password",
|
||||
- hostname, username, prompt);
|
||||
+ auth_info_required, auth_info_default, auth_info_display, auth_info_visible, prompt);
|
||||
|
||||
g_free (prompt);
|
||||
}
|
||||
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ {
|
||||
+ g_free (auth_info_required[i]);
|
||||
+ g_free (auth_info_default[i]);
|
||||
+ g_free (auth_info_display[i]);
|
||||
+ }
|
||||
+
|
||||
+ g_free (auth_info_required);
|
||||
+ g_free (auth_info_default);
|
||||
+ g_free (auth_info_display);
|
||||
+ g_free (auth_info_visible);
|
||||
g_free (key);
|
||||
|
||||
return FALSE;
|
||||
@@ -828,6 +897,133 @@ cups_dispatch_add_poll (GSource *source)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
+check_auth_info (gpointer user_data)
|
||||
+{
|
||||
+ GtkPrintCupsDispatchWatch *dispatch;
|
||||
+ dispatch = (GtkPrintCupsDispatchWatch *) user_data;
|
||||
+
|
||||
+ if (!dispatch->request->need_auth_info)
|
||||
+ {
|
||||
+ if (dispatch->request->auth_info == NULL)
|
||||
+ {
|
||||
+ dispatch->callback (GTK_PRINT_BACKEND (dispatch->backend),
|
||||
+ gtk_cups_request_get_result (dispatch->request),
|
||||
+ dispatch->callback_data);
|
||||
+ g_source_destroy ((GSource *) dispatch);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ gint length;
|
||||
+ gint i;
|
||||
+
|
||||
+ length = g_strv_length (dispatch->request->auth_info_required);
|
||||
+
|
||||
+ gtk_cups_request_ipp_add_strings (dispatch->request,
|
||||
+ IPP_TAG_JOB,
|
||||
+ IPP_TAG_TEXT,
|
||||
+ "auth-info",
|
||||
+ length,
|
||||
+ NULL,
|
||||
+ dispatch->request->auth_info);
|
||||
+
|
||||
+ g_source_attach ((GSource *) dispatch, NULL);
|
||||
+ g_source_unref ((GSource *) dispatch);
|
||||
+
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ overwrite_and_free (dispatch->request->auth_info[i]);
|
||||
+ g_free (dispatch->request->auth_info);
|
||||
+ dispatch->request->auth_info = NULL;
|
||||
+ }
|
||||
+
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+request_auth_info (gpointer user_data)
|
||||
+{
|
||||
+ GtkPrintCupsDispatchWatch *dispatch;
|
||||
+ const char *job_title;
|
||||
+ const char *printer_uri;
|
||||
+ gchar *prompt = NULL;
|
||||
+ char *printer_name = NULL;
|
||||
+ gint length;
|
||||
+ gint i;
|
||||
+ gboolean *auth_info_visible = NULL;
|
||||
+ gchar **auth_info_default = NULL;
|
||||
+ gchar **auth_info_display = NULL;
|
||||
+
|
||||
+ dispatch = (GtkPrintCupsDispatchWatch *) user_data;
|
||||
+
|
||||
+ if (dispatch->backend->authentication_lock)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ job_title = gtk_cups_request_ipp_get_string (dispatch->request, IPP_TAG_NAME, "job-name");
|
||||
+ printer_uri = gtk_cups_request_ipp_get_string (dispatch->request, IPP_TAG_URI, "printer-uri");
|
||||
+ length = g_strv_length (dispatch->request->auth_info_required);
|
||||
+
|
||||
+ auth_info_visible = g_new0 (gboolean, length);
|
||||
+ auth_info_default = g_new0 (gchar *, length + 1);
|
||||
+ auth_info_display = g_new0 (gchar *, length + 1);
|
||||
+
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ {
|
||||
+ if (g_strcmp0 (dispatch->request->auth_info_required[i], "domain") == 0)
|
||||
+ {
|
||||
+ auth_info_display[i] = g_strdup (_("Domain:"));
|
||||
+ auth_info_default[i] = g_strdup ("WORKGROUP");
|
||||
+ auth_info_visible[i] = TRUE;
|
||||
+ }
|
||||
+ else if (g_strcmp0 (dispatch->request->auth_info_required[i], "username") == 0)
|
||||
+ {
|
||||
+ auth_info_display[i] = g_strdup (_("Username:"));
|
||||
+ if (dispatch->backend->username != NULL)
|
||||
+ auth_info_default[i] = g_strdup (dispatch->backend->username);
|
||||
+ else
|
||||
+ auth_info_default[i] = g_strdup (cupsUser ());
|
||||
+ auth_info_visible[i] = TRUE;
|
||||
+ }
|
||||
+ else if (g_strcmp0 (dispatch->request->auth_info_required[i], "password") == 0)
|
||||
+ {
|
||||
+ auth_info_display[i] = g_strdup (_("Password:"));
|
||||
+ auth_info_visible[i] = FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (printer_uri != NULL && strrchr (printer_uri, '/') != NULL)
|
||||
+ printer_name = g_strdup (strrchr (printer_uri, '/') + 1);
|
||||
+
|
||||
+ dispatch->backend->authentication_lock = TRUE;
|
||||
+
|
||||
+ if (job_title != NULL && printer_name != NULL)
|
||||
+ prompt = g_strdup_printf ( _("Authentication informations are required to print document '%s' on printer %s"), job_title, printer_name);
|
||||
+
|
||||
+ g_signal_emit_by_name (dispatch->backend, "request-password",
|
||||
+ dispatch->request->auth_info_required,
|
||||
+ auth_info_default,
|
||||
+ auth_info_display,
|
||||
+ auth_info_visible,
|
||||
+ prompt);
|
||||
+
|
||||
+ for (i = 0; i < length; i++)
|
||||
+ {
|
||||
+ g_free (auth_info_default[i]);
|
||||
+ g_free (auth_info_display[i]);
|
||||
+ }
|
||||
+
|
||||
+ g_free (auth_info_default);
|
||||
+ g_free (auth_info_display);
|
||||
+ g_free (printer_name);
|
||||
+ g_free (prompt);
|
||||
+
|
||||
+ g_idle_add (check_auth_info, user_data);
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
cups_dispatch_watch_check (GSource *source)
|
||||
{
|
||||
GtkPrintCupsDispatchWatch *dispatch;
|
||||
@@ -1008,13 +1204,24 @@ cups_request_execute (GtkPrintBackendCups *print_backend,
|
||||
dispatch->request = request;
|
||||
dispatch->backend = g_object_ref (print_backend);
|
||||
dispatch->data_poll = NULL;
|
||||
+ dispatch->callback = NULL;
|
||||
+ dispatch->callback_data = NULL;
|
||||
|
||||
print_backend->requests = g_list_prepend (print_backend->requests, dispatch);
|
||||
|
||||
g_source_set_callback ((GSource *) dispatch, (GSourceFunc) callback, user_data, notify);
|
||||
|
||||
- g_source_attach ((GSource *) dispatch, NULL);
|
||||
- g_source_unref ((GSource *) dispatch);
|
||||
+ if (request->need_auth_info)
|
||||
+ {
|
||||
+ dispatch->callback = callback;
|
||||
+ dispatch->callback_data = user_data;
|
||||
+ request_auth_info (dispatch);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ g_source_attach ((GSource *) dispatch, NULL);
|
||||
+ g_source_unref ((GSource *) dispatch);
|
||||
+ }
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1435,6 +1642,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
|
||||
gchar *default_cover_before = NULL;
|
||||
gchar *default_cover_after = NULL;
|
||||
gboolean remote_printer = FALSE;
|
||||
+ gchar **auth_info_required = NULL;
|
||||
|
||||
/* Skip leading attributes until we hit a printer...
|
||||
*/
|
||||
@@ -1553,6 +1761,15 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
|
||||
else
|
||||
remote_printer = FALSE;
|
||||
}
|
||||
+ else if (strcmp (attr->name, "auth-info-required") == 0)
|
||||
+ {
|
||||
+ if (strcmp (attr->values[0].string.text, "none") != 0)
|
||||
+ {
|
||||
+ auth_info_required = g_new0 (gchar *, attr->num_values + 1);
|
||||
+ for (i = 0; i < attr->num_values; i++)
|
||||
+ auth_info_required[i] = g_strdup (attr->values[i].string.text);
|
||||
+ }
|
||||
+ }
|
||||
else
|
||||
{
|
||||
GTK_NOTE (PRINTING,
|
||||
@@ -1674,6 +1891,9 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
|
||||
cups_printer->hostname = g_strdup (hostname);
|
||||
cups_printer->port = port;
|
||||
|
||||
+ cups_printer->auth_info_required = g_strdupv (auth_info_required);
|
||||
+ g_strfreev (auth_info_required);
|
||||
+
|
||||
printer = GTK_PRINTER (cups_printer);
|
||||
|
||||
if (cups_backend->default_printer != NULL &&
|
||||
@@ -1866,7 +2086,8 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
|
||||
"printer-is-accepting-jobs",
|
||||
"job-sheets-supported",
|
||||
"job-sheets-default",
|
||||
- "printer-type"
|
||||
+ "printer-type",
|
||||
+ "auth-info-required"
|
||||
};
|
||||
|
||||
if (cups_backend->list_printers_pending)
|
||||
diff --git a/modules/printbackends/cups/gtkprintercups.c b/modules/printbackends/cups/gtkprintercups.c
|
||||
index cd27b17..efdb0e5 100644
|
||||
--- a/modules/printbackends/cups/gtkprintercups.c
|
||||
+++ b/modules/printbackends/cups/gtkprintercups.c
|
||||
@@ -77,6 +77,7 @@ gtk_printer_cups_init (GtkPrinterCups *printer)
|
||||
printer->ppd_file = NULL;
|
||||
printer->default_cover_before = NULL;
|
||||
printer->default_cover_after = NULL;
|
||||
+ printer->auth_info_required = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -94,6 +95,7 @@ gtk_printer_cups_finalize (GObject *object)
|
||||
g_free (printer->ppd_name);
|
||||
g_free (printer->default_cover_before);
|
||||
g_free (printer->default_cover_after);
|
||||
+ g_strfreev (printer->auth_info_required);
|
||||
|
||||
if (printer->ppd_file)
|
||||
ppdClose (printer->ppd_file);
|
||||
diff --git a/modules/printbackends/cups/gtkprintercups.h b/modules/printbackends/cups/gtkprintercups.h
|
||||
index cd2b318..7a869a0 100644
|
||||
--- a/modules/printbackends/cups/gtkprintercups.h
|
||||
+++ b/modules/printbackends/cups/gtkprintercups.h
|
||||
@@ -47,6 +47,7 @@ struct _GtkPrinterCups
|
||||
gchar *printer_uri;
|
||||
gchar *hostname;
|
||||
gint port;
|
||||
+ gchar **auth_info_required;
|
||||
|
||||
ipp_pstate_t state;
|
||||
gboolean reading_ppd;
|
||||
--
|
||||
1.6.2.5
|
||||
|
108
gtk2.spec
108
gtk2.spec
@ -11,13 +11,13 @@
|
||||
%define libpng_version 2:1.2.2-16
|
||||
%define xrandr_version 1.2.99.4-2
|
||||
|
||||
%define base_version 2.18.0
|
||||
%define base_version 2.18.3
|
||||
%define bin_version 2.10.0
|
||||
|
||||
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
|
||||
Name: gtk2
|
||||
Version: %{base_version}
|
||||
Release: 5%{?dist}
|
||||
Release: 16%{?dist}
|
||||
License: LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
Source: http://download.gnome.org/sources/gtk+/2.18/gtk+-%{version}.tar.bz2
|
||||
@ -27,15 +27,25 @@ Source3: im-cedilla.conf
|
||||
|
||||
# Biarch changes
|
||||
Patch0: gtk+-2.13.5-lib64.patch
|
||||
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=566522
|
||||
Patch1: gtk2-printing-smb-auth.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=586207
|
||||
Patch2: gtk2-printing-nonblocking-printer-list.patch
|
||||
Patch1: system-python.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=583273
|
||||
Patch2: icon-padding.patch
|
||||
# from upstream
|
||||
Patch3: fix-anchors.patch
|
||||
Patch3: image-size-alloc.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=599617
|
||||
Patch4: fresh-tooltips.patch
|
||||
# from upstream
|
||||
Patch4: iconview-crash.patch
|
||||
Patch5: allow-set-hint.patch
|
||||
# from upstream
|
||||
Patch6: compose-sequences.patch
|
||||
# from upstream
|
||||
Patch7: symbolic-color-parsing.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=599618
|
||||
Patch8: tooltip-positioning.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=581150
|
||||
Patch9: iconview-hang.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=599446
|
||||
Patch10: toolbutton-assert.patch
|
||||
|
||||
BuildRequires: atk-devel >= %{atk_version}
|
||||
BuildRequires: pango-devel >= %{pango_version}
|
||||
@ -147,15 +157,16 @@ This package contains developer documentation for the GTK+ widget toolkit.
|
||||
%setup -q -n gtk+-%{version}
|
||||
|
||||
%patch0 -p1 -b .lib64
|
||||
%patch1 -p1 -b .printing-smb-auth
|
||||
%patch2 -p1 -b .printing-nonblocking-printer-list
|
||||
%patch3 -p1 -b .fix-anchors
|
||||
%patch4 -p1 -b .iconview-crash
|
||||
|
||||
# make sure that gtkmarshalers.{c, h} get regenerated during the build
|
||||
# - caused by print_authentication.patch
|
||||
rm --force ./gtk/gtkmarshalers.c
|
||||
rm --force ./gtk/gtkmarshalers.h
|
||||
%patch1 -p1 -b .system-python
|
||||
%patch2 -p1 -b .icon-padding
|
||||
%patch3 -p1 -b .image-size-alloc
|
||||
%patch4 -p1 -b .fresh-tooltips
|
||||
%patch5 -p1 -b .allow-set-hint
|
||||
%patch6 -p1 -b .compose-sequences
|
||||
%patch7 -p1 -b .symbolic-color-parsing
|
||||
%patch8 -p1 -b .tooltip-positioning
|
||||
%patch9 -p1 -b .iconview-hang
|
||||
%patch10 -p1 -b .toolbutton-assert
|
||||
|
||||
%build
|
||||
libtoolize --force --copy
|
||||
@ -392,6 +403,67 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Oct 31 2009 Matthias Clasen <mclasen@redhta.com> - 2.18.3-16
|
||||
- Handle screen changes for tooltips (#531568)
|
||||
|
||||
* Wed Oct 28 2009 Matthias Clasen <mclasen@redhta.com> - 2.18.3-15
|
||||
- Work around a bug in the X automatic compositor (#531443)
|
||||
|
||||
* Wed Oct 28 2009 Matthias Clasen <mclasen@redhta.com> - 2.18.3-14
|
||||
- Make the new tooltips sharp
|
||||
- Improve the Metacity compositor workaround for new tooltips
|
||||
|
||||
* Mon Oct 26 2009 Matthias Clasen <mclasen@redhta.com> - 2.18.3-12
|
||||
- Fix a possible assertion failure in GtkToolButton
|
||||
|
||||
* Fri Oct 23 2009 Matthew Barnes <mbarnes@redhat.com> - 2.18.3-11
|
||||
- Fix a GtkIconView hang
|
||||
|
||||
* Fri Oct 23 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-10
|
||||
- Tweak tooltip positioning
|
||||
- Make new tooltip style an opt-in theme choice
|
||||
|
||||
* Thu Oct 22 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-9
|
||||
- Fix a problem with parsing symbolic colors in rc files (#528662)
|
||||
|
||||
* Thu Oct 22 2009 Peter Hutterer <peter.hutterer@redhat.com> - 2.18.3-8
|
||||
- compose-sequences.patch: update compose sequences to what's currently in
|
||||
libX11 git.
|
||||
|
||||
* Wed Oct 21 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-7
|
||||
- Try to catch some nm-applet problems by rejecting requests to
|
||||
load icons at size 0
|
||||
|
||||
* Wed Oct 21 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-6
|
||||
- Hack around metacity compositor limitations
|
||||
|
||||
* Wed Oct 21 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-5
|
||||
- Tweak tooltip appearance
|
||||
|
||||
* Tue Oct 20 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-4
|
||||
- Make tooltips look nicer
|
||||
|
||||
* Sun Oct 18 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-3
|
||||
- Fix a size allocation problem uncovered by the previous patch
|
||||
|
||||
* Sat Oct 17 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-2
|
||||
- Support padding around status icons
|
||||
|
||||
* Sat Oct 17 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.3-1
|
||||
- Update to 2.18.3
|
||||
|
||||
* Tue Oct 13 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.2-3
|
||||
- Make gtk-builder-convert use system python
|
||||
|
||||
* Fri Oct 9 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.2-2
|
||||
- Make selecting the final char work again (#528072)
|
||||
|
||||
* Mon Oct 5 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.2-1
|
||||
- Update to 2.18.2
|
||||
|
||||
* Wed Sep 30 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.1-1
|
||||
- Update to 2.18.1
|
||||
|
||||
* Mon Sep 28 2009 Matthias Clasen <mclasen@redhat.com> - 2.18.0-3
|
||||
- Fix a crash in the appearance capplet
|
||||
|
||||
|
261
icon-padding.patch
Normal file
261
icon-padding.patch
Normal file
@ -0,0 +1,261 @@
|
||||
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
|
||||
index 1cdb0c1..62b3913 100644
|
||||
--- a/gtk/gtkstatusicon.c
|
||||
+++ b/gtk/gtkstatusicon.c
|
||||
@@ -170,6 +170,7 @@ static void gtk_status_icon_screen_changed (GtkStatusIcon *status_icon,
|
||||
GdkScreen *old_screen);
|
||||
static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon);
|
||||
static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon);
|
||||
+static void gtk_status_icon_padding_changed (GtkStatusIcon *status_icon);
|
||||
static gboolean gtk_status_icon_scroll (GtkStatusIcon *status_icon,
|
||||
GdkEventScroll *event);
|
||||
static gboolean gtk_status_icon_query_tooltip (GtkStatusIcon *status_icon,
|
||||
@@ -850,6 +851,8 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
G_CALLBACK (gtk_status_icon_embedded_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "notify::orientation",
|
||||
G_CALLBACK (gtk_status_icon_orientation_changed), status_icon);
|
||||
+ g_signal_connect_swapped (priv->tray_icon, "notify::padding",
|
||||
+ G_CALLBACK (gtk_status_icon_padding_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "button-press-event",
|
||||
G_CALLBACK (gtk_status_icon_button_press), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "button-release-event",
|
||||
@@ -975,6 +978,8 @@ gtk_status_icon_finalize (GObject *object)
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_orientation_changed, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
+ gtk_status_icon_padding_changed, status_icon);
|
||||
+ g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_button_press, status_icon);
|
||||
g_signal_handlers_disconnect_by_func (priv->tray_icon,
|
||||
gtk_status_icon_button_release, status_icon);
|
||||
@@ -1679,14 +1684,32 @@ gtk_status_icon_screen_changed (GtkStatusIcon *status_icon,
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
|
||||
static void
|
||||
+gtk_status_icon_padding_changed (GtkStatusIcon *status_icon)
|
||||
+{
|
||||
+ GtkStatusIconPrivate *priv = status_icon->priv;
|
||||
+ GtkOrientation orientation;
|
||||
+ gint padding;
|
||||
+
|
||||
+ orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (priv->tray_icon));
|
||||
+ padding = _gtk_tray_icon_get_padding (GTK_TRAY_ICON (priv->tray_icon));
|
||||
+
|
||||
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
+ gtk_misc_set_padding (GTK_MISC (priv->image), padding, 0);
|
||||
+ else
|
||||
+ gtk_misc_set_padding (GTK_MISC (priv->image), 0, padding);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon)
|
||||
{
|
||||
+ gtk_status_icon_padding_changed (status_icon);
|
||||
g_object_notify (G_OBJECT (status_icon), "embedded");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon)
|
||||
{
|
||||
+ gtk_status_icon_padding_changed (status_icon);
|
||||
g_object_notify (G_OBJECT (status_icon), "orientation");
|
||||
}
|
||||
|
||||
@@ -1804,7 +1827,7 @@ gtk_status_icon_reset_image_data (GtkStatusIcon *status_icon)
|
||||
|
||||
g_object_notify (G_OBJECT (status_icon), "stock");
|
||||
break;
|
||||
-
|
||||
+
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
g_free (priv->image_data.icon_name);
|
||||
priv->image_data.icon_name = NULL;
|
||||
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
|
||||
index 32c3140..74413df 100644
|
||||
--- a/gtk/gtktrayicon-x11.c
|
||||
+++ b/gtk/gtktrayicon-x11.c
|
||||
@@ -43,23 +43,26 @@
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
- PROP_ORIENTATION
|
||||
+ PROP_ORIENTATION,
|
||||
+ PROP_PADDING
|
||||
};
|
||||
|
||||
struct _GtkTrayIconPrivate
|
||||
{
|
||||
guint stamp;
|
||||
-
|
||||
+
|
||||
Atom selection_atom;
|
||||
Atom manager_atom;
|
||||
Atom system_tray_opcode_atom;
|
||||
Atom orientation_atom;
|
||||
Atom visual_atom;
|
||||
+ Atom padding_atom;
|
||||
Window manager_window;
|
||||
GdkVisual *manager_visual;
|
||||
gboolean manager_visual_rgba;
|
||||
|
||||
GtkOrientation orientation;
|
||||
+ gint padding;
|
||||
};
|
||||
|
||||
static void gtk_tray_icon_constructed (GObject *object);
|
||||
@@ -113,6 +116,16 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class)
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
+ g_object_class_install_property (gobject_class,
|
||||
+ PROP_PADDING,
|
||||
+ g_param_spec_int ("padding",
|
||||
+ P_("Padding"),
|
||||
+ P_("Padding that should be put around icons in the tray"),
|
||||
+ 0,
|
||||
+ G_MAXINT,
|
||||
+ 0,
|
||||
+ GTK_PARAM_READABLE));
|
||||
+
|
||||
g_type_class_add_private (class, sizeof (GtkTrayIconPrivate));
|
||||
}
|
||||
|
||||
@@ -124,6 +137,7 @@ gtk_tray_icon_init (GtkTrayIcon *icon)
|
||||
|
||||
icon->priv->stamp = 1;
|
||||
icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||
+ icon->priv->padding = 0;
|
||||
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE);
|
||||
gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
|
||||
@@ -161,6 +175,10 @@ gtk_tray_icon_constructed (GObject *object)
|
||||
"_NET_SYSTEM_TRAY_VISUAL",
|
||||
False);
|
||||
|
||||
+ icon->priv->padding_atom = XInternAtom (xdisplay,
|
||||
+ "_NET_SYSTEM_TRAY_PADDING",
|
||||
+ False);
|
||||
+
|
||||
/* Add a root window filter so that we get changes on MANAGER */
|
||||
gdk_window_add_filter (root_window,
|
||||
gtk_tray_icon_manager_filter, icon);
|
||||
@@ -212,6 +230,9 @@ gtk_tray_icon_get_property (GObject *object,
|
||||
case PROP_ORIENTATION:
|
||||
g_value_set_enum (value, icon->priv->orientation);
|
||||
break;
|
||||
+ case PROP_PADDING:
|
||||
+ g_value_set_int (value, icon->priv->padding);
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@@ -372,9 +393,58 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
|
||||
XFree (prop.prop);
|
||||
}
|
||||
|
||||
+static void
|
||||
+gtk_tray_icon_get_padding_property (GtkTrayIcon *icon)
|
||||
+{
|
||||
+ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon));
|
||||
+ GdkDisplay *display = gdk_screen_get_display (screen);
|
||||
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
+
|
||||
+ Atom type;
|
||||
+ int format;
|
||||
+ union {
|
||||
+ gulong *prop;
|
||||
+ guchar *prop_ch;
|
||||
+ } prop = { NULL };
|
||||
+ gulong nitems;
|
||||
+ gulong bytes_after;
|
||||
+ int error, result;
|
||||
+
|
||||
+ g_assert (icon->priv->manager_window != None);
|
||||
+
|
||||
+ gdk_error_trap_push ();
|
||||
+ type = None;
|
||||
+ result = XGetWindowProperty (xdisplay,
|
||||
+ icon->priv->manager_window,
|
||||
+ icon->priv->padding_atom,
|
||||
+ 0, G_MAXLONG, FALSE,
|
||||
+ XA_CARDINAL,
|
||||
+ &type, &format, &nitems,
|
||||
+ &bytes_after, &(prop.prop_ch));
|
||||
+ error = gdk_error_trap_pop ();
|
||||
+
|
||||
+ if (!error && result == Success &&
|
||||
+ type == XA_CARDINAL && nitems == 1 && format == 32)
|
||||
+ {
|
||||
+ gint padding;
|
||||
+
|
||||
+ padding = prop.prop[0];
|
||||
+
|
||||
+ if (icon->priv->padding != padding)
|
||||
+ {
|
||||
+ icon->priv->padding = padding;
|
||||
+
|
||||
+ g_object_notify (G_OBJECT (icon), "padding");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (type != None)
|
||||
+ XFree (prop.prop);
|
||||
+}
|
||||
+
|
||||
static GdkFilterReturn
|
||||
-gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
- GdkEvent *event,
|
||||
+gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
+ GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkTrayIcon *icon = user_data;
|
||||
@@ -399,6 +469,11 @@ gtk_tray_icon_manager_filter (GdkXEvent *xevent,
|
||||
|
||||
gtk_tray_icon_get_orientation_property (icon);
|
||||
}
|
||||
+ else if (xev->xany.type == PropertyNotify &&
|
||||
+ xev->xproperty.atom == icon->priv->padding_atom)
|
||||
+ {
|
||||
+ gtk_tray_icon_get_padding_property (icon);
|
||||
+ }
|
||||
else if (xev->xany.type == DestroyNotify)
|
||||
{
|
||||
GTK_NOTE (PLUGSOCKET,
|
||||
@@ -504,6 +579,7 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon)
|
||||
|
||||
gtk_tray_icon_get_orientation_property (icon);
|
||||
gtk_tray_icon_get_visual_property (icon);
|
||||
+ gtk_tray_icon_get_padding_property (icon);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (icon))
|
||||
{
|
||||
@@ -740,6 +816,14 @@ _gtk_tray_icon_get_orientation (GtkTrayIcon *icon)
|
||||
return icon->priv->orientation;
|
||||
}
|
||||
|
||||
+gint
|
||||
+_gtk_tray_icon_get_padding (GtkTrayIcon *icon)
|
||||
+{
|
||||
+ g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), 0);
|
||||
+
|
||||
+ return icon->priv->padding;
|
||||
+}
|
||||
+
|
||||
|
||||
#define __GTK_TRAY_ICON_X11_C__
|
||||
#include "gtkaliasdef.c"
|
||||
diff --git a/gtk/gtktrayicon.h b/gtk/gtktrayicon.h
|
||||
index 4c1e184..6dc9852 100644
|
||||
--- a/gtk/gtktrayicon.h
|
||||
+++ b/gtk/gtktrayicon.h
|
||||
@@ -69,7 +69,8 @@ void _gtk_tray_icon_cancel_message (GtkTrayIcon *icon,
|
||||
guint id);
|
||||
|
||||
GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon);
|
||||
-
|
||||
+gint _gtk_tray_icon_get_padding (GtkTrayIcon *icon);
|
||||
+
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_TRAY_ICON_H__ */
|
@ -1,23 +0,0 @@
|
||||
diff -up gtk+-2.18.0/gtk/gtkiconview.c.iconview-crash gtk+-2.18.0/gtk/gtkiconview.c
|
||||
--- gtk+-2.18.0/gtk/gtkiconview.c.iconview-crash 2009-09-28 12:38:46.956098207 -0400
|
||||
+++ gtk+-2.18.0/gtk/gtkiconview.c 2009-09-28 12:40:03.636858596 -0400
|
||||
@@ -3469,6 +3469,9 @@ gtk_icon_view_get_item_at_coords (GtkIco
|
||||
GList *items, *l;
|
||||
GdkRectangle box;
|
||||
|
||||
+ if (cell_at_pos)
|
||||
+ *cell_at_pos = NULL;
|
||||
+
|
||||
for (items = icon_view->priv->items; items; items = items->next)
|
||||
{
|
||||
GtkIconViewItem *item = items->data;
|
||||
@@ -3503,9 +3506,6 @@ gtk_icon_view_get_item_at_coords (GtkIco
|
||||
}
|
||||
}
|
||||
|
||||
- if (cell_at_pos)
|
||||
- *cell_at_pos = NULL;
|
||||
-
|
||||
if (only_in_cell)
|
||||
return NULL;
|
||||
}
|
15
iconview-hang.patch
Normal file
15
iconview-hang.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -up gtk+-2.18.3/gtk/gtkiconview.c.icon-view-hang gtk+-2.18.3/gtk/gtkiconview.c
|
||||
--- gtk+-2.18.3/gtk/gtkiconview.c.icon-view-hang 2009-10-09 01:00:44.000000000 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtkiconview.c 2009-10-23 20:09:18.670311545 -0400
|
||||
@@ -1545,6 +1545,11 @@ gtk_icon_view_expose (GtkWidget *widget,
|
||||
if (expose->window != icon_view->priv->bin_window)
|
||||
return FALSE;
|
||||
|
||||
+ /* If a layout has been scheduled, do it now so that all
|
||||
+ * cell view items have valid sizes before we proceed. */
|
||||
+ if (icon_view->priv->layout_idle_id != 0)
|
||||
+ gtk_icon_view_layout (icon_view);
|
||||
+
|
||||
cr = gdk_cairo_create (icon_view->priv->bin_window);
|
||||
cairo_set_line_width (cr, 1.);
|
||||
|
73
image-size-alloc.patch
Normal file
73
image-size-alloc.patch
Normal file
@ -0,0 +1,73 @@
|
||||
--- /home/mclasen/git.gnome.org/gtk+/gtk/gtkimage.c 2009-06-04 15:18:04.063943764 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtkimage.c 2009-10-18 01:31:00.705062264 -0400
|
||||
@@ -45,6 +45,7 @@
|
||||
gchar *filename;
|
||||
|
||||
gint pixel_size;
|
||||
+ guint need_calc_size : 1;
|
||||
};
|
||||
|
||||
#define GTK_IMAGE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_IMAGE, GtkImagePrivate))
|
||||
@@ -1710,6 +1711,7 @@
|
||||
{
|
||||
GtkImage *image;
|
||||
GtkMisc *misc;
|
||||
+ GtkImagePrivate *priv;
|
||||
GdkRectangle area, image_bound;
|
||||
gfloat xalign;
|
||||
gint x, y, mask_x, mask_y;
|
||||
@@ -1719,6 +1721,7 @@
|
||||
|
||||
image = GTK_IMAGE (widget);
|
||||
misc = GTK_MISC (widget);
|
||||
+ priv = GTK_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
area = event->area;
|
||||
|
||||
@@ -1727,7 +1730,7 @@
|
||||
* and size_request() if something explicitely forces
|
||||
* a redraw.
|
||||
*/
|
||||
- if (widget->requisition.width == 0 && widget->requisition.height == 0)
|
||||
+ if (priv->need_calc_size)
|
||||
gtk_image_calc_size (image);
|
||||
|
||||
if (!gdk_rectangle_intersect (&area, &widget->allocation, &area))
|
||||
@@ -1737,7 +1740,7 @@
|
||||
xalign = misc->xalign;
|
||||
else
|
||||
xalign = 1.0 - misc->xalign;
|
||||
-
|
||||
+
|
||||
x = floor (widget->allocation.x + misc->xpad
|
||||
+ ((widget->allocation.width - widget->requisition.width) * xalign));
|
||||
y = floor (widget->allocation.y + misc->ypad
|
||||
@@ -2149,8 +2152,13 @@
|
||||
void
|
||||
gtk_image_clear (GtkImage *image)
|
||||
{
|
||||
- gtk_image_reset (image);
|
||||
+ GtkImagePrivate *priv;
|
||||
+
|
||||
+ priv = GTK_IMAGE_GET_PRIVATE (image);
|
||||
+
|
||||
+ priv->need_calc_size = 1;
|
||||
|
||||
+ gtk_image_reset (image);
|
||||
gtk_image_update_size (image, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2159,7 +2167,12 @@
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (image);
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
-
|
||||
+ GtkImagePrivate *priv;
|
||||
+
|
||||
+ priv = GTK_IMAGE_GET_PRIVATE (image);
|
||||
+
|
||||
+ priv->need_calc_size = 0;
|
||||
+
|
||||
/* We update stock/icon set on every size request, because
|
||||
* the theme could have affected the size; for other kinds of
|
||||
* image, we just update the requisition when the image data
|
File diff suppressed because it is too large
Load Diff
@ -1,17 +0,0 @@
|
||||
diff -up gtk+-2.17.11/gdk/x11/gdkwindow-x11.c.event-mask gtk+-2.17.11/gdk/x11/gdkwindow-x11.c
|
||||
--- gtk+-2.17.11/gdk/x11/gdkwindow-x11.c.event-mask 2009-09-06 21:31:08.926764157 -0400
|
||||
+++ gtk+-2.17.11/gdk/x11/gdkwindow-x11.c 2009-09-06 21:32:03.142614346 -0400
|
||||
@@ -455,8 +455,12 @@ _gdk_windowing_window_init (GdkScreen *
|
||||
private->width = WidthOfScreen (screen_x11->xscreen);
|
||||
private->height = HeightOfScreen (screen_x11->xscreen);
|
||||
private->viewable = TRUE;
|
||||
+
|
||||
+ /* see init_randr_support() in gdkscreen-x11.c */
|
||||
+ private->event_mask = GDK_STRUCTURE_MASK;
|
||||
+
|
||||
_gdk_window_update_size (screen_x11->root_window);
|
||||
-
|
||||
+
|
||||
_gdk_xid_table_insert (screen_x11->display,
|
||||
&screen_x11->xroot_window,
|
||||
screen_x11->root_window);
|
@ -1,15 +0,0 @@
|
||||
diff -up gtk+-2.17.6/gdk/gdkwindow.c.set-cursor gtk+-2.17.6/gdk/gdkwindow.c
|
||||
--- gtk+-2.17.6/gdk/gdkwindow.c.set-cursor 2009-08-11 14:26:41.041772299 -0400
|
||||
+++ gtk+-2.17.6/gdk/gdkwindow.c 2009-08-11 14:27:40.703522466 -0400
|
||||
@@ -6982,7 +6982,10 @@ gdk_window_set_cursor (GdkWindow *window
|
||||
if (cursor)
|
||||
private->cursor = gdk_cursor_ref (cursor);
|
||||
|
||||
- if (_gdk_window_event_parent_of (window, display->pointer_info.window_under_pointer))
|
||||
+ if (private->window_type == GDK_WINDOW_ROOT ||
|
||||
+ private->window_type == GDK_WINDOW_FOREIGN)
|
||||
+ GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_cursor (window, cursor);
|
||||
+ else if (_gdk_window_event_parent_of (window, display->pointer_info.window_under_pointer))
|
||||
update_cursor (display);
|
||||
}
|
||||
}
|
160
symbolic-color-parsing.patch
Normal file
160
symbolic-color-parsing.patch
Normal file
@ -0,0 +1,160 @@
|
||||
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
|
||||
index a2ac58b..70540a3 100644
|
||||
--- a/gtk/gtkrc.c
|
||||
+++ b/gtk/gtkrc.c
|
||||
@@ -659,11 +659,15 @@ gtk_rc_color_hash_changed (GtkSettings *settings,
|
||||
GParamSpec *pspec,
|
||||
GtkRcContext *context)
|
||||
{
|
||||
- if (context->color_hash)
|
||||
- g_hash_table_unref (context->color_hash);
|
||||
-
|
||||
+ GHashTable *old_hash;
|
||||
+
|
||||
+ old_hash = context->color_hash;
|
||||
+
|
||||
g_object_get (settings, "color-hash", &context->color_hash, NULL);
|
||||
|
||||
+ if (old_hash)
|
||||
+ g_hash_table_unref (old_hash);
|
||||
+
|
||||
gtk_rc_reparse_all_for_settings (settings, TRUE);
|
||||
}
|
||||
|
||||
@@ -3148,8 +3152,10 @@ gtk_rc_parse_style (GtkRcContext *context,
|
||||
break;
|
||||
case GTK_RC_TOKEN_COLOR:
|
||||
if (our_hash == NULL)
|
||||
- gtk_rc_style_prepend_empty_color_hash (rc_style);
|
||||
- our_hash = rc_priv->color_hashes->data;
|
||||
+ {
|
||||
+ gtk_rc_style_prepend_empty_color_hash (rc_style);
|
||||
+ our_hash = rc_priv->color_hashes->data;
|
||||
+ }
|
||||
token = gtk_rc_parse_logical_color (scanner, rc_style, our_hash);
|
||||
break;
|
||||
case G_TOKEN_IDENTIFIER:
|
||||
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
|
||||
index 4917263..2b6b24e 100644
|
||||
--- a/gtk/gtksettings.c
|
||||
+++ b/gtk/gtksettings.c
|
||||
@@ -2190,8 +2190,8 @@ settings_update_color_scheme (GtkSettings *settings)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-add_color_to_hash (gchar *name,
|
||||
- GdkColor *color,
|
||||
+add_color_to_hash (gchar *name,
|
||||
+ GdkColor *color,
|
||||
GHashTable *target)
|
||||
{
|
||||
GdkColor *old;
|
||||
@@ -2200,7 +2200,7 @@ add_color_to_hash (gchar *name,
|
||||
if (!old || !gdk_color_equal (old, color))
|
||||
{
|
||||
g_hash_table_insert (target, g_strdup (name), gdk_color_copy (color));
|
||||
-
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2208,7 +2208,7 @@ add_color_to_hash (gchar *name,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-add_colors_to_hash_from_string (GHashTable *hash,
|
||||
+add_colors_to_hash_from_string (GHashTable *hash,
|
||||
const gchar *colors)
|
||||
{
|
||||
gchar *s, *p, *name;
|
||||
@@ -2256,24 +2256,27 @@ add_colors_to_hash_from_string (GHashTable *hash,
|
||||
|
||||
static gboolean
|
||||
update_color_hash (ColorSchemeData *data,
|
||||
- const gchar *str,
|
||||
+ const gchar *str,
|
||||
GtkSettingsSource source)
|
||||
{
|
||||
gboolean changed = FALSE;
|
||||
gint i;
|
||||
GHashTable *old_hash;
|
||||
+ GHashTableIter iter;
|
||||
+ gchar *name;
|
||||
+ GdkColor *color;
|
||||
|
||||
- if ((str == NULL || *str == '\0') &&
|
||||
+ if ((str == NULL || *str == '\0') &&
|
||||
(data->lastentry[source] == NULL || data->lastentry[source][0] == '\0'))
|
||||
return FALSE;
|
||||
|
||||
if (str && data->lastentry[source] && strcmp (str, data->lastentry[source]) == 0)
|
||||
return FALSE;
|
||||
|
||||
- /* For the RC_FILE source we merge the values rather than over-writing
|
||||
+ /* For the RC_FILE source we merge the values rather than over-writing
|
||||
* them, since multiple rc files might define independent sets of colors
|
||||
*/
|
||||
- if ((source != GTK_SETTINGS_SOURCE_RC_FILE) &&
|
||||
+ if ((source != GTK_SETTINGS_SOURCE_RC_FILE) &&
|
||||
data->tables[source] && g_hash_table_size (data->tables[source]) > 0)
|
||||
{
|
||||
g_hash_table_unref (data->tables[source]);
|
||||
@@ -2282,22 +2285,36 @@ update_color_hash (ColorSchemeData *data,
|
||||
}
|
||||
|
||||
if (data->tables[source] == NULL)
|
||||
- data->tables[source] = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
+ data->tables[source] = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free,
|
||||
(GDestroyNotify) gdk_color_free);
|
||||
|
||||
g_free (data->lastentry[source]);
|
||||
data->lastentry[source] = g_strdup (str);
|
||||
-
|
||||
+
|
||||
changed |= add_colors_to_hash_from_string (data->tables[source], str);
|
||||
|
||||
if (!changed)
|
||||
return FALSE;
|
||||
-
|
||||
+
|
||||
/* Rebuild the merged hash table. */
|
||||
- old_hash = data->color_hash;
|
||||
- data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||
- (GDestroyNotify) gdk_color_free);
|
||||
+ if (data->color_hash)
|
||||
+ {
|
||||
+ old_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||
+ (GDestroyNotify) gdk_color_free);
|
||||
+
|
||||
+ g_hash_table_iter_init (&iter, data->color_hash);
|
||||
+ while (g_hash_table_iter_next (&iter, &name, &color))
|
||||
+ {
|
||||
+ g_hash_table_insert (old_hash, name, color);
|
||||
+ g_hash_table_iter_steal (&iter);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ old_hash = NULL;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i <= GTK_SETTINGS_SOURCE_APPLICATION; i++)
|
||||
{
|
||||
if (data->tables[i])
|
||||
@@ -2324,13 +2341,13 @@ update_color_hash (ColorSchemeData *data,
|
||||
{
|
||||
changed = TRUE;
|
||||
break;
|
||||
- }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
g_hash_table_unref (old_hash);
|
||||
}
|
||||
- else
|
||||
+ else
|
||||
changed = TRUE;
|
||||
|
||||
return changed;
|
23
toolbutton-assert.patch
Normal file
23
toolbutton-assert.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff -up gtk+-2.18.3/gtk/gtktoolbutton.c.toolbutton-assert gtk+-2.18.3/gtk/gtktoolbutton.c
|
||||
--- gtk+-2.18.3/gtk/gtktoolbutton.c.toolbutton-assert 2009-10-16 10:38:56.000000000 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtktoolbutton.c 2009-10-26 01:12:26.146186990 -0400
|
||||
@@ -916,11 +916,15 @@ gtk_tool_button_set_label (GtkToolButton
|
||||
button->priv->label_text = g_strdup (label);
|
||||
button->priv->contents_invalid = TRUE;
|
||||
|
||||
- elided_label = _gtk_toolbar_elide_underscores (label);
|
||||
- accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button));
|
||||
- atk_object_set_name (accessible, elided_label);
|
||||
+ if (label)
|
||||
+ {
|
||||
+ elided_label = _gtk_toolbar_elide_underscores (label);
|
||||
+ accessible = gtk_widget_get_accessible (GTK_WIDGET (button->priv->button));
|
||||
+ atk_object_set_name (accessible, elided_label);
|
||||
+
|
||||
+ g_free (elided_label);
|
||||
+ }
|
||||
|
||||
- g_free (elided_label);
|
||||
g_free (old_label);
|
||||
|
||||
g_object_notify (G_OBJECT (button), "label");
|
190
tooltip-positioning.patch
Normal file
190
tooltip-positioning.patch
Normal file
@ -0,0 +1,190 @@
|
||||
diff -up gtk+-2.18.3/gtk/gtktooltip.c.positioning gtk+-2.18.3/gtk/gtktooltip.c
|
||||
--- gtk+-2.18.3/gtk/gtktooltip.c.positioning 2009-10-23 13:12:16.205437913 -0400
|
||||
+++ gtk+-2.18.3/gtk/gtktooltip.c 2009-10-23 13:52:15.922749329 -0400
|
||||
@@ -1023,57 +1023,134 @@ gtk_tooltip_position (GtkTooltip *toolti
|
||||
GtkWidget *new_tooltip_widget)
|
||||
{
|
||||
gint x, y;
|
||||
+ gint wx, wy;
|
||||
GdkScreen *screen;
|
||||
+ gint monitor_num;
|
||||
+ GdkRectangle monitor;
|
||||
+ GtkRequisition requisition;
|
||||
+ guint cursor_size;
|
||||
+
|
||||
+#define MAX_DISTANCE 32
|
||||
|
||||
tooltip->tooltip_widget = new_tooltip_widget;
|
||||
|
||||
+ screen = gtk_widget_get_screen (new_tooltip_widget);
|
||||
+
|
||||
+ gtk_widget_size_request (GTK_WIDGET (tooltip->current_window), &requisition);
|
||||
+
|
||||
+ monitor_num = gdk_screen_get_monitor_at_point (screen,
|
||||
+ tooltip->last_x,
|
||||
+ tooltip->last_y);
|
||||
+ gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
+
|
||||
+ gdk_window_get_origin (new_tooltip_widget->window, &wx, &wy);
|
||||
+ if (GTK_WIDGET_NO_WINDOW (new_tooltip_widget))
|
||||
+ {
|
||||
+ wx += new_tooltip_widget->allocation.x;
|
||||
+ wy += new_tooltip_widget->allocation.y;
|
||||
+ }
|
||||
+
|
||||
/* Position the tooltip */
|
||||
- /* FIXME: should we swap this when RTL is enabled? */
|
||||
- if (tooltip->keyboard_mode_enabled)
|
||||
+
|
||||
+ cursor_size = gdk_display_get_default_cursor_size (display);
|
||||
+
|
||||
+ /* Try below */
|
||||
+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
|
||||
+ y = wy + new_tooltip_widget->allocation.height + 4;
|
||||
+
|
||||
+ if (y + requisition.height <= monitor.y + monitor.height)
|
||||
{
|
||||
- gdk_window_get_origin (new_tooltip_widget->window, &x, &y);
|
||||
- if (GTK_WIDGET_NO_WINDOW (new_tooltip_widget))
|
||||
+ if (tooltip->keyboard_mode_enabled)
|
||||
+ goto found;
|
||||
+
|
||||
+ if (y <= tooltip->last_y + cursor_size + MAX_DISTANCE)
|
||||
{
|
||||
- x += new_tooltip_widget->allocation.x;
|
||||
- y += new_tooltip_widget->allocation.y;
|
||||
- }
|
||||
+ if (tooltip->last_x + cursor_size + MAX_DISTANCE < x)
|
||||
+ x = tooltip->last_x + cursor_size + MAX_DISTANCE;
|
||||
+ else if (x + requisition.width < tooltip->last_x - MAX_DISTANCE)
|
||||
+ x = tooltip->last_x - MAX_DISTANCE - requisition.width;
|
||||
|
||||
- /* For keyboard mode we position the tooltip below the widget,
|
||||
- * right of the center of the widget.
|
||||
- */
|
||||
- x += new_tooltip_widget->allocation.width / 2;
|
||||
- y += new_tooltip_widget->allocation.height + 4;
|
||||
+ goto found;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Try above */
|
||||
+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
|
||||
+ y = wy - requisition.height - 4;
|
||||
+
|
||||
+ if (y >= monitor.y)
|
||||
+ {
|
||||
+ if (tooltip->keyboard_mode_enabled)
|
||||
+ goto found;
|
||||
+
|
||||
+ if (y + requisition.height >= tooltip->last_y - MAX_DISTANCE)
|
||||
+ {
|
||||
+ if (tooltip->last_x + cursor_size + MAX_DISTANCE < x)
|
||||
+ x = tooltip->last_x + cursor_size + MAX_DISTANCE;
|
||||
+ else if (x + requisition.width < tooltip->last_x - MAX_DISTANCE)
|
||||
+ x = tooltip->last_x - MAX_DISTANCE - requisition.width;
|
||||
+
|
||||
+ goto found;
|
||||
+ }
|
||||
}
|
||||
- else
|
||||
+
|
||||
+ /* Try right FIXME: flip on rtl ? */
|
||||
+ x = wx + new_tooltip_widget->allocation.width + 4;
|
||||
+ y = wy + new_tooltip_widget->allocation.height / 2 - requisition.height / 2;
|
||||
+
|
||||
+ if (x + requisition.width <= monitor.x + monitor.width)
|
||||
{
|
||||
- guint cursor_size;
|
||||
+ if (tooltip->keyboard_mode_enabled)
|
||||
+ goto found;
|
||||
|
||||
- x = tooltip->last_x;
|
||||
- y = tooltip->last_y;
|
||||
+ if (x <= tooltip->last_x + cursor_size + MAX_DISTANCE)
|
||||
+ {
|
||||
+ if (tooltip->last_y + cursor_size + MAX_DISTANCE < y)
|
||||
+ y = tooltip->last_y + cursor_size + MAX_DISTANCE;
|
||||
+ else if (y + requisition.height < tooltip->last_y - MAX_DISTANCE)
|
||||
+ y = tooltip->last_y - MAX_DISTANCE - requisition.height;
|
||||
|
||||
- /* For mouse mode, we position the tooltip right of the cursor,
|
||||
- * a little below the cursor's center.
|
||||
- */
|
||||
- cursor_size = gdk_display_get_default_cursor_size (display);
|
||||
- x += cursor_size / 2;
|
||||
- y += cursor_size / 2;
|
||||
+ goto found;
|
||||
+ }
|
||||
}
|
||||
|
||||
- screen = gtk_widget_get_screen (new_tooltip_widget);
|
||||
+ /* Try left FIXME: flip on rtl ? */
|
||||
+ x = wx - requisition.width - 4;
|
||||
+ y = wy + new_tooltip_widget->allocation.height / 2 - requisition.height / 2;
|
||||
|
||||
- /* Show it */
|
||||
- if (tooltip->current_window)
|
||||
+ if (x >= monitor.x)
|
||||
{
|
||||
- gint monitor_num;
|
||||
- GdkRectangle monitor;
|
||||
- GtkRequisition requisition;
|
||||
+ if (tooltip->keyboard_mode_enabled)
|
||||
+ goto found;
|
||||
|
||||
- gtk_widget_size_request (GTK_WIDGET (tooltip->current_window),
|
||||
- &requisition);
|
||||
+ if (x + requisition.width >= tooltip->last_x - MAX_DISTANCE)
|
||||
+ {
|
||||
+ if (tooltip->last_y + cursor_size + MAX_DISTANCE < y)
|
||||
+ y = tooltip->last_y + cursor_size + MAX_DISTANCE;
|
||||
+ else if (y + requisition.height < tooltip->last_y - MAX_DISTANCE)
|
||||
+ y = tooltip->last_y - MAX_DISTANCE - requisition.height;
|
||||
|
||||
- monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
|
||||
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
|
||||
+ goto found;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
+ /* Fallback */
|
||||
+ if (tooltip->keyboard_mode_enabled)
|
||||
+ {
|
||||
+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
|
||||
+ y = wy + new_tooltip_widget->allocation.height + 4;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* At cursor */
|
||||
+ x = tooltip->last_x + cursor_size * 3 / 4;
|
||||
+ y = tooltip->last_y + cursor_size * 3 / 4;
|
||||
+ }
|
||||
+
|
||||
+found:
|
||||
+ /* Show it */
|
||||
+ if (tooltip->current_window)
|
||||
+ {
|
||||
if (x + requisition.width > monitor.x + monitor.width)
|
||||
x -= x - (monitor.x + monitor.width) + requisition.width;
|
||||
else if (x < monitor.x)
|
||||
@@ -1081,7 +1158,9 @@ gtk_tooltip_position (GtkTooltip *toolti
|
||||
|
||||
if (y + requisition.height > monitor.y + monitor.height)
|
||||
y -= y - (monitor.y + monitor.height) + requisition.height;
|
||||
-
|
||||
+ else if (y < monitor.y)
|
||||
+ y = monitor.y;
|
||||
+
|
||||
if (!tooltip->keyboard_mode_enabled)
|
||||
{
|
||||
/* don't pop up under the pointer */
|
||||
@@ -1089,7 +1168,7 @@ gtk_tooltip_position (GtkTooltip *toolti
|
||||
y <= tooltip->last_y && tooltip->last_y < y + requisition.height)
|
||||
y = tooltip->last_y - requisition.height - 2;
|
||||
}
|
||||
-
|
||||
+
|
||||
gtk_window_move (GTK_WINDOW (tooltip->current_window), x, y);
|
||||
gtk_widget_show (GTK_WIDGET (tooltip->current_window));
|
||||
}
|
Loading…
Reference in New Issue
Block a user