]> git.pld-linux.org Git - packages/qt.git/blob - qt-x11-free-misc.patch
- desc why patches are commented out
[packages/qt.git] / qt-x11-free-misc.patch
1 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qapplication_x11.cpp qt-x11-free-3.3.2/src/kernel/qapplication_x11.cpp
2 --- qt-x11-free-3.3.2.orig/src/kernel/qapplication_x11.cpp      2004-04-19 11:36:02.000000000 +0200
3 +++ qt-x11-free-3.3.2/src/kernel/qapplication_x11.cpp   2004-05-12 23:10:49.895694064 +0200
4 @@ -241,7 +241,11 @@
5  Atom           qt_gbackground_properties       = 0;
6  Atom           qt_x_incr               = 0;
7  Atom           qt_utf8_string = 0;
8 +
9 +// detect broken window managers
10 +Atom            qt_sgi_desks_manager    = 0;
11  bool           qt_broken_wm            = FALSE;
12 +static void qt_detect_broken_window_manager();
13  
14  // NET WM support
15  Atom           qt_net_supported        = 0;
16 @@ -1013,7 +1017,7 @@
17      }
18  
19      qt_broken_wm =
20 -       settings.readBoolEntry("/qt/brokenWindowManager", FALSE);
21 +       settings.readBoolEntry("/qt/brokenWindowManager", qt_broken_wm);
22  
23      qt_resolve_symlinks =
24         settings.readBoolEntry("/qt/resolveSymlinks", TRUE);
25 @@ -1289,6 +1293,27 @@
26  }
27  
28  
29 +static void qt_detect_broken_window_manager()
30 +{
31 +    Atom type;
32 +    int format;
33 +    ulong nitems, after;
34 +    uchar *data = 0;
35 +
36 +    // look for SGI's 4Dwm
37 +    int e = XGetWindowProperty(appDpy, QPaintDevice::x11AppRootWindow(),
38 +                               qt_sgi_desks_manager, 0, 1, False, XA_WINDOW,
39 +                               &type, &format, &nitems, &after, &data);
40 +    if (data)
41 +        XFree(data);
42 +
43 +    if (e == Success && type == XA_WINDOW && format == 32 && nitems == 1 && after == 0) {
44 +        // detected SGI 4Dwm
45 +        qt_broken_wm = TRUE;
46 +    }
47 +}
48 +
49 +
50  // update the supported array
51  void qt_get_net_supported()
52  {
53 @@ -1892,6 +1917,7 @@
54         qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name );
55         qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name );
56         qt_x11_intern_atom( "UTF8_STRING", &qt_utf8_string );
57 +        qt_x11_intern_atom( "_SGI_DESKS_MANAGER", &qt_sgi_desks_manager );
58  
59         qt_xdnd_setup();
60         qt_x11_motifdnd_init();
61 @@ -1899,6 +1925,9 @@
62         // Finally create all atoms
63         qt_x11_process_intern_atoms();
64  
65 +        // look for broken window managers
66 +        qt_detect_broken_window_manager();
67 +
68         // initialize NET lists
69         qt_get_net_supported();
70         qt_get_net_virtual_roots();
71 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase.cpp qt-x11-free-3.3.2/src/kernel/qfontdatabase.cpp
72 --- qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase.cpp 2004-04-19 11:36:07.000000000 +0200
73 +++ qt-x11-free-3.3.2/src/kernel/qfontdatabase.cpp      2004-05-12 23:10:49.897693768 +0200
74 @@ -467,7 +467,7 @@
75      // Ogham,
76      0x1680,
77      // SpacingModifiers,
78 -    0x02b0,
79 +    0x02c7,
80      // CombiningMarks,
81      0x0300,
82  
83 @@ -543,15 +543,15 @@
84      // LetterlikeSymbols,
85      0x2122,
86      // NumberForms,
87 -    0x215b,
88 +    0x2160,
89      // MathematicalOperators,
90      0x222b,
91      // TechnicalSymbols,
92 -    0x2440,
93 +    0x2312,
94      // GeometricSymbols,
95      0x2500,
96      // MiscellaneousSymbols,
97 -    0x2600,
98 +    0x2640,
99      // EnclosedAndSquare,
100      0x2460,
101      // Braille,
102 @@ -920,12 +920,14 @@
103               script, scriptName( script ).latin1(),
104               request.weight, request.italic, request.stretch, request.pixelSize, pitch );
105  
106 +    bool usesFontConfig = FALSE;
107  #ifdef QT_XFT2
108      if (family_name.isEmpty()
109         || family_name == "Sans Serif"
110         || family_name == "Serif"
111         || family_name == "Monospace") {
112         fe = loadFontConfigFont(fp, request, script);
113 +        usesFontConfig = (fe != 0);
114      }
115      if (!fe)
116  #endif
117 @@ -949,7 +951,7 @@
118  #ifdef Q_WS_WIN
119                  && ucstricmp( try_family->english_name, family_name ) != 0
120  #endif
121 -                )
122 +                )
123                 continue;
124  
125             if ( family_name.isEmpty() )
126 @@ -969,7 +971,7 @@
127                         override_script = QFont::Han_SimplifiedChinese;
128                         score_adjust = 200;
129                     } else if (override_script == QFont::Han_SimplifiedChinese
130 -                       && (try_family->scripts[QFont::Han_TraditionalChinese] & QtFontFamily::Supported)) {
131 +                               && (try_family->scripts[QFont::Han_TraditionalChinese] & QtFontFamily::Supported)) {
132                         override_script = QFont::Han_TraditionalChinese;
133                         score_adjust = 200;
134                     } else {
135 @@ -978,20 +980,20 @@
136                     }
137                 } else
138  #endif
139 -               if (family_name.isEmpty()) {
140 -                   continue;
141 -               } else if (try_family->scripts[QFont::UnknownScript] & QtFontFamily::Supported) {
142 -                   // try with the unknown script (for a symbol font)
143 -                   override_script = QFont::UnknownScript;
144 +                    if (family_name.isEmpty()) {
145 +                        continue;
146 +                    } else if (try_family->scripts[QFont::UnknownScript] & QtFontFamily::Supported) {
147 +                        // try with the unknown script (for a symbol font)
148 +                        override_script = QFont::UnknownScript;
149  #ifndef QT_XFT2
150 -               } else if (try_family->scripts[QFont::Unicode] & QtFontFamily::Supported) {
151 -                   // try with the unicode script instead
152 -                   override_script = QFont::Unicode;
153 -#endif
154 -               } else {
155 -                   // family not supported by unicode/unknown scripts
156 -                   continue;
157 -               }
158 +                    } else if (try_family->scripts[QFont::Unicode] & QtFontFamily::Supported) {
159 +                        // try with the unicode script instead
160 +                        override_script = QFont::Unicode;
161 +#endif
162 +                    } else {
163 +                        // family not supported by unicode/unknown scripts
164 +                        continue;
165 +                    }
166             }
167  
168             QtFontFoundry *try_foundry = 0;
169 @@ -1134,7 +1136,12 @@
170         }
171  
172         if ( fp ) {
173 -           QFontCache::Key key( request, script,
174 +            QFontDef def = request;
175 +            if (def.family.isEmpty()) {
176 +                def.family = fp->request.family;
177 +                def.family = def.family.left(def.family.find(','));
178 +            }
179 +           QFontCache::Key key( def, script,
180  #ifdef Q_WS_WIN
181                                  (int)fp->paintdevice
182  #else
183 @@ -1142,15 +1149,17 @@
184  #endif
185                 );
186             QFontCache::instance->insertEngine( key, fe );
187 -           for ( int i = 0; i < QFont::NScripts; ++i ) {
188 -               if ( i == script ) continue;
189 -
190 -               if (!canRender(fe, (QFont::Script) i))
191 -                   continue;
192 -
193 -               key.script = i;
194 -               QFontCache::instance->insertEngine( key, fe );
195 -           }
196 +            if (!usesFontConfig) {
197 +                for ( int i = 0; i < QFont::NScripts; ++i ) {
198 +                    if ( i == script ) continue;
199 +
200 +                    if (!canRender(fe, (QFont::Script) i))
201 +                        continue;
202 +
203 +                    key.script = i;
204 +                    QFontCache::instance->insertEngine( key, fe );
205 +                }
206 +            }
207         }
208      } else {
209         if ( request.family.isEmpty() ) {
210 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase_x11.cpp qt-x11-free-3.3.2/src/kernel/qfontdatabase_x11.cpp
211 --- qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase_x11.cpp     2004-04-19 11:36:05.000000000 +0200
212 +++ qt-x11-free-3.3.2/src/kernel/qfontdatabase_x11.cpp  2004-05-12 23:10:49.899693472 +0200
213 @@ -973,8 +973,11 @@
214         QtFontFoundry *foundry
215             = family->foundry( QString::null,  TRUE );
216  
217 -       for ( int i = 0; i < QFont::LastPrivateScript; ++i )
218 +       for ( int i = 0; i < QFont::LastPrivateScript; ++i ) {
219 +            if (i == QFont::UnknownScript)
220 +                continue;
221             family->scripts[i] = QtFontFamily::Supported;
222 +        }
223  
224         QtFontStyle::Key styleKey;
225         styleKey.oblique = FALSE;
226 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontengine_x11.cpp qt-x11-free-3.3.2/src/kernel/qfontengine_x11.cpp
227 --- qt-x11-free-3.3.2.orig/src/kernel/qfontengine_x11.cpp       2004-04-19 11:36:09.000000000 +0200
228 +++ qt-x11-free-3.3.2/src/kernel/qfontengine_x11.cpp    2004-05-12 23:10:49.891694657 +0200
229 @@ -1395,29 +1395,17 @@
230         xftfs->charmap = -1;
231      }
232  #else
233 -    int symbol = -1;
234 -    int charmap = -1;
235 +    _cmap = -1;
236 +    // Xft maps Unicode and adobe roman for us.
237      for (int i = 0; i < _face->num_charmaps; ++i) {
238 -       FT_CharMap cm = _face->charmaps[i];
239 -//     qDebug("font has charmap %x", cm->encoding);
240 -       if (charmap == -1 && cm->encoding == ft_encoding_unicode)
241 -           charmap = i;
242 -       // we don't use FT_ENCODING_MS_SYMBOL in 3.3, as it maps to U+0xf0xx. All of the fonts
243 -       // tested also provide a FT_ENCODING_APPLE_ROMAN table that works for the basic range.
244 -       if (symbol == -1
245 -           && (/*cm->encoding == FT_ENCODING_MS_SYMBOL ||*/
246 -               cm->encoding == ft_encoding_adobe_custom
247 -               || cm->encoding == ft_encoding_apple_roman)) {
248 -           symbol = i;
249 -       }
250 -    }
251 -
252 -    // symbol font
253 -    if (symbol != -1 && (charmap == -1 || cmap))
254 -       charmap = symbol;
255 -    if (charmap != -1) {
256 -//     qDebug("using charmap %x", _face->charmaps[charmap]->encoding);
257 -       FT_Set_Charmap(_face, _face->charmaps[charmap]);
258 +        FT_CharMap cm = _face->charmaps[i];
259 +//         qDebug("font has charmap %x", cm->encoding);
260 +        if (cm->encoding == ft_encoding_adobe_custom
261 +            || cm->encoding == ft_encoding_symbol) {
262 +//             qDebug("font has adobe custom or ms symbol charmap");
263 +            _cmap = i;
264 +            break;
265 +        }
266      }
267  #endif // QT_XFT2
268  
269 @@ -1458,6 +1446,15 @@
270      }
271  }
272  
273 +static glyph_t getAdobeCharIndex(XftFont *font, int cmap, uint ucs4)
274 +{
275 +    FT_Face _face = XftLockFace( font );
276 +    FT_Set_Charmap(_face, _face->charmaps[cmap]);
277 +    glyph_t g = FT_Get_Char_Index(_face, ucs4);
278 +    XftUnlockFace(font);
279 +    return g;
280 +}
281 +
282  QFontEngine::Error QFontEngineXft::stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const
283  {
284      if ( *nglyphs < len ) {
285 @@ -1473,7 +1470,7 @@
286             if ( !glyphs[i] ) {
287                 if (uc == 0xa0)
288                     uc = 0x20;
289 -               glyph_t glyph = FT_Get_Char_Index(_face, uc);
290 +               glyph_t glyph = XftCharIndex(0, _font, uc);
291                 glyphs[i] = glyph;
292                 if ( uc < cmapCacheSize )
293                     ((QFontEngineXft *)this)->cmapCache[uc] = glyph;
294 @@ -1486,7 +1483,7 @@
295             if ( !glyphs[i] ) {
296                 if (uc == 0xa0)
297                     uc = 0x20;
298 -               glyph_t glyph = FT_Get_Char_Index(_face, uc);
299 +               glyph_t glyph = XftCharIndex(0, _font, uc);
300                 glyphs[i] = glyph;
301                 if ( uc < cmapCacheSize )
302                     ((QFontEngineXft *)this)->cmapCache[uc] = glyph;
303 @@ -2067,13 +2064,22 @@
304      bool allExist = TRUE;
305  
306  #ifdef QT_XFT2
307 -    for ( int i = 0; i < len; i++ ) {
308 -       if (!FT_Get_Char_Index(_face, string[i].unicode())) {
309 -           allExist = FALSE;
310 -           break;
311 -       }
312 +    if (_cmap != -1) {
313 +        for ( int i = 0; i < len; i++ ) {
314 +            if (!XftCharExists(0, _font, string[i].unicode())
315 +                && getAdobeCharIndex(_font, _cmap, string[i].unicode()) == 0) {
316 +                allExist = FALSE;
317 +                break;
318 +            }
319 +        }
320 +    } else {
321 +        for ( int i = 0; i < len; i++ ) {
322 +            if (!XftCharExists(0, _font, string[i].unicode())) {
323 +                allExist = FALSE;
324 +                break;
325 +            }
326 +        }
327      }
328 -
329  #else
330      glyph_t glyphs[256];
331      int nglyphs = 255;
332 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qscriptengine_x11.cpp qt-x11-free-3.3.2/src/kernel/qscriptengine_x11.cpp
333 --- qt-x11-free-3.3.2.orig/src/kernel/qscriptengine_x11.cpp     2004-04-19 11:36:07.000000000 +0200
334 +++ qt-x11-free-3.3.2/src/kernel/qscriptengine_x11.cpp  2004-05-12 23:10:49.906692436 +0200
335 @@ -1533,7 +1533,8 @@
336  
337         openType->applyGSUBFeature(FT_MAKE_TAG( 'c', 'c', 'm', 'p' ));
338  
339 -       where[0] = TRUE;
340 +       where[0] = (from == 0
341 +                    || !(string.unicode()[from-1].isLetter() ||  string.unicode()[from-1].isMark()));
342         openType->applyGSUBFeature(FT_MAKE_TAG( 'i', 'n', 'i', 't' ), where);
343         openType->applyGSUBFeature(FT_MAKE_TAG( 'n', 'u', 'k', 't' ));
344  
345 @@ -1720,7 +1721,7 @@
346         switch( newState ) {
347         case Control:
348             newState = state;
349 -           if (state == Halant)
350 +           if (state == Halant && uc[pos].unicode() == 0x200d /* ZWJ */)
351                 break;
352             goto finish;
353         case Consonant:
354 @@ -2257,8 +2258,8 @@
355      KHDEBUG("state[%d]=%d (uc=%4x)", pos, state, uc[pos].unicode() );
356      pos++;
357  
358 -    if (state != Khmer_Cons) {
359 -       if (state != Khmer_IndV && state != Khmer_Other)
360 +    if (state != Khmer_Cons && state != Khmer_IndV) {
361 +       if (state != Khmer_Other)
362             *invalid = TRUE;
363         goto finish;
364      }
365 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qtextengine.cpp qt-x11-free-3.3.2/src/kernel/qtextengine.cpp
366 --- qt-x11-free-3.3.2.orig/src/kernel/qtextengine.cpp   2004-04-19 11:36:07.000000000 +0200
367 +++ qt-x11-free-3.3.2/src/kernel/qtextengine.cpp        2004-05-12 23:10:49.907692288 +0200
368 @@ -53,6 +53,7 @@
369  #define BIDI_DEBUG 0//2
370  #if (BIDI_DEBUG >= 1)
371  #include <iostream>
372 +using namespace std;
373  
374  static const char *directions[] = {
375      "DirL", "DirR", "DirEN", "DirES", "DirET", "DirAN", "DirCS", "DirB", "DirS", "DirWS", "DirON",
376 @@ -419,7 +420,8 @@
377                 case QChar::DirON:
378                     if( status.eor != QChar::DirR && status.eor != QChar::DirAL ) {
379                         //last stuff takes embedding dir
380 -                       if(control.direction() == QChar::DirR || status.lastStrong == QChar::DirR) {
381 +                       if(control.direction() == QChar::DirR
382 +                           || status.lastStrong == QChar::DirR || status.lastStrong == QChar::DirAL) {
383                             appendItems(engine, sor, eor, control, dir);
384                             dir = QChar::DirON; status.eor = QChar::DirON;
385                             dir = QChar::DirR;
This page took 0.09028 seconds and 3 git commands to generate.