~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/dialogs/dialog-events.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Authors:
7
7
 *   bulia byak <bulia@dr.com>
 
8
 *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
8
9
 *
9
 
 * Copyright (C) 2003 authors
 
10
 * Copyright (C) 2003-2007 Authors
10
11
 *
11
12
 * Released under GNU GPL, read the file 'COPYING' for more information
12
13
 */
64
65
 *
65
66
 */
66
67
void
67
 
sp_dialog_defocus_callback (GtkWindow *win, gpointer data)
 
68
sp_dialog_defocus_callback (GtkWindow */*win*/, gpointer data)
68
69
{
69
70
    sp_dialog_defocus ((GtkWindow *)
70
71
        gtk_widget_get_toplevel ((GtkWidget *) data));
145
146
void
146
147
sp_transientize (GtkWidget *dialog)
147
148
{
 
149
#ifndef WIN32  // FIXME: Temporary Win32 special code to enable transient dialogs
 
150
    // _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs
 
151
    // are made transient (_set_transient_for), they are already removed from
 
152
    // the taskbar in Win32.
148
153
    if (prefs_get_int_attribute ( "options.dialogsskiptaskbar", "value", 0)) {
149
154
        gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
150
155
    }
 
156
#endif
151
157
 
152
158
    gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2 );
153
159
 
 
160
#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
 
161
    if (prefs_get_int_attribute ( "options.dialogsontopwin32", "value", 0))
 
162
        transient_policy = 2;
 
163
    else
 
164
        transient_policy = 0;
 
165
#endif
 
166
 
154
167
    if (transient_policy) {
155
 
   
 
168
 
156
169
    // if there's an active document window, attach dialog to it as a transient:
157
 
    
 
170
 
158
171
        if ( SP_ACTIVE_DESKTOP )
159
172
        {
160
173
            SP_ACTIVE_DESKTOP->setWindowTransient (dialog, transient_policy);
168
181
}
169
182
 
170
183
void
171
 
sp_transientize_callback ( Inkscape::Application * /*inkscape*/, 
 
184
sp_transientize_callback ( Inkscape::Application * /*inkscape*/,
172
185
                           SPDesktop *desktop, win_data *wd )
173
186
{
174
 
    gint transient_policy = 
175
 
        prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 
176
 
                                          1, 0, 2);
177
 
 
178
 
    if (!transient_policy) 
179
 
        return;
180
 
 
181
 
    if (wd->stop) { 
182
 
        /* 
183
 
         * if retransientizing of this dialog is still forbidden after 
184
 
         * previous call warning turned off because it was confusingly fired 
 
187
    gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2);
 
188
 
 
189
#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
 
190
    if (prefs_get_int_attribute ( "options.dialogsontopwin32", "value", 0))
 
191
        transient_policy = 2;
 
192
    else
 
193
        return;
 
194
#endif
 
195
 
 
196
    if (!transient_policy)
 
197
        return;
 
198
 
 
199
    if (wd->stop) {
 
200
        /*
 
201
         * if retransientizing of this dialog is still forbidden after
 
202
         * previous call warning turned off because it was confusingly fired
185
203
         * when loading many files from command line
186
204
         */
187
 
         // g_warning("Retranzientize aborted! You're switching windows too fast!"); 
 
205
         // g_warning("Retranzientize aborted! You're switching windows too fast!");
188
206
        return;
189
207
    }
190
 
    
 
208
 
191
209
    if (wd->win)
192
210
    {
193
211
        wd->stop = 1; // disallow other attempts to retranzientize this dialog
194
212
        desktop->setWindowTransient (wd->win, transient_policy);
195
213
    }
196
 
    
 
214
 
197
215
    // we're done, allow next retransientizing not sooner than after 6 msec
198
 
    gtk_timeout_add (6, (GtkFunction) sp_allow_again, (gpointer) wd);  
 
216
    gtk_timeout_add (6, (GtkFunction) sp_allow_again, (gpointer) wd);
199
217
}
200
218
 
201
219
void on_dialog_hide (GtkWidget *w)
211
229
}
212
230
 
213
231
gboolean
214
 
sp_dialog_hide (GtkObject *object, gpointer data)
 
232
sp_dialog_hide (GtkObject */*object*/, gpointer data)
215
233
{
216
234
    GtkWidget *dlg = (GtkWidget *) data;
217
235
 
224
242
 
225
243
 
226
244
gboolean
227
 
sp_dialog_unhide (GtkObject *object, gpointer data)
 
245
sp_dialog_unhide (GtkObject */*object*/, gpointer data)
228
246
{
229
247
    GtkWidget *dlg = (GtkWidget *) data;
230
248