Skip to content

Commit

Permalink
#2195 fix gtk3 error when cancelling the save dialog
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@22201 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 21, 2019
1 parent c5eef78 commit 9606456
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/client/gtk_base/session_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
add_close_accel, label, title_box, \
TableBuilder, imagebutton, get_preferred_size, get_gtk_version_info, \
RELIEF_NONE, RELIEF_NORMAL, EXPAND, FILL, WIN_POS_CENTER,
RESPONSE_CANCEL, RESPONSE_OK,
RESPONSE_CANCEL, RESPONSE_OK, RESPONSE_CLOSE, RESPONSE_DELETE_EVENT,
FILE_CHOOSER_ACTION_SAVE,
)
from xpra.net.net_util import get_network_caps
Expand Down Expand Up @@ -1217,7 +1217,7 @@ def save_graph(self, _ebox, btn, graph):
log("saving surface %s to %s", surface, filename)
with open(filename, "wb") as f:
surface.write_to_png(f)
elif response in (gtk.RESPONSE_CANCEL, gtk.RESPONSE_CLOSE, gtk.RESPONSE_DELETE_EVENT):
elif response in (RESPONSE_CANCEL, RESPONSE_CLOSE, RESPONSE_DELETE_EVENT):
log("closed/cancelled")
else:
log.warn("unknown chooser response: %d" % response)
Expand Down
5 changes: 5 additions & 0 deletions src/xpra/gtk_common/gtk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ def pixbuf_new_from_data(*args):
RESPONSE_CANCEL = gtk.ResponseType.CANCEL
RESPONSE_OK = gtk.ResponseType.OK
RESPONSE_ACCEPT = gtk.ResponseType.ACCEPT
RESPONSE_CLOSE = gtk.ResponseType.CLOSE
RESPONSE_DELETE_EVENT = gtk.ResponseType.DELETE_EVENT


WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN
WINDOW_STATE_ICONIFIED = gdk.WindowState.ICONIFIED
Expand Down Expand Up @@ -547,6 +550,8 @@ def cairo_set_source_pixbuf(cr, pixbuf, x, y):
RESPONSE_CANCEL = gtk.RESPONSE_CANCEL
RESPONSE_OK = gtk.RESPONSE_OK
RESPONSE_ACCEPT = gtk.RESPONSE_ACCEPT
RESPONSE_CLOSE = gtk.RESPONSE_CLOSE
RESPONSE_DELETE_EVENT = gtk.RESPONSE_DELETE_EVENT

WINDOW_STATE_WITHDRAWN = gdk.WINDOW_STATE_WITHDRAWN
WINDOW_STATE_ICONIFIED = gdk.WINDOW_STATE_ICONIFIED
Expand Down

0 comments on commit 9606456

Please sign in to comment.