Package list xapp / 650a3cc
xapp-gtk-window.c: Check for x11 at a more appropriate time. The safety initially added in fea3ca82f missed the fact that xapp_gtk_window_realize() directly called update_window_progress() and update_window_icon(), bypassing our safeties. It's best to move these checks to those methods instead. Michael Webster 3 years ago
1 changed file(s) with 8 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
168168 update_window_icon (GtkWindow *window,
169169 XAppGtkWindowPrivate *priv)
170170 {
171 if (!is_x11_session ()) {
172 return;
173 }
174
171175 /* Icon name/path */
172176 if (priv->icon_name != NULL)
173177 {
193197 update_window_progress (GtkWindow *window,
194198 XAppGtkWindowPrivate *priv)
195199 {
200 if (!is_x11_session ()) {
201 return;
202 }
203
196204 /* Progress: 0 - 100 */
197205 set_window_hint_cardinal (get_window_xid (window),
198206 PROGRESS_HINT,
208216 XAppGtkWindowPrivate *priv,
209217 const gchar *icon_name)
210218 {
211 if (!is_x11_session ()) {
212 goto out;
213 }
214
215219 if (g_strcmp0 (icon_name, priv->icon_name) == 0)
216220 {
217221 gtk_window_set_icon_name (window, icon_name);
234238 update_window_icon (window, priv);
235239 }
236240
237 out:
238241 /* Call the GtkWindow method for compatibility */
239242 gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
240243 }
245248 const gchar *file_name,
246249 GError **error)
247250 {
248 if (!is_x11_session ()) {
249 goto out;
250 }
251
252251 if (g_strcmp0 (file_name, priv->icon_path) == 0)
253252 {
254253 gtk_window_set_icon_from_file (window, file_name, error);
271270 update_window_icon (window, priv);
272271 }
273272
274 out:
275273 gtk_window_set_icon_from_file (GTK_WINDOW (window), file_name, error);
276274 }
277275
280278 XAppGtkWindowPrivate *priv,
281279 gint progress)
282280 {
283 if (!is_x11_session ()) {
284 return;
285 }
286
287281 gboolean update;
288282 guint clamped_progress;
289283
319313 XAppGtkWindowPrivate *priv,
320314 gboolean pulse)
321315 {
322 if (!is_x11_session ()) {
323 return;
324 }
325
326316 gboolean update;
327317
328318 update = FALSE;