xapp-gtk-window: Trap X errors when setting progress
This should be a best effort feature for applications
and it shouldn't ever result in making applications
segfault.
Note: This could be tested easily by setting progress on
an erroneous XID. This resulted in a BadWindow crash.
With this commit, the error is now trapped and no impact
is suffered on the calling application.
Clement Lefebvre
6 years ago
109 | 109 | GdkDisplay *display; |
110 | 110 | |
111 | 111 | display = gdk_display_get_default (); |
112 | ||
113 | gdk_error_trap_push (); | |
112 | 114 | |
113 | 115 | if (cardinal > 0) |
114 | 116 | { |
125 | 127 | xid, |
126 | 128 | gdk_x11_get_xatom_by_name_for_display (display, atom_name)); |
127 | 129 | } |
130 | ||
131 | gdk_error_trap_pop (); | |
128 | 132 | } |
129 | 133 | |
130 | 134 | static Window |