Problem with preview and the blocking print dialog



I'm implementing the preview code in gtkprint.  I have decided to use an
external helper (default is evince) to do print preview.  The idea was
to write out to a pdf in /tmp and launch the external helper when the
user hits the preview button.  The print dialog would stick around even
after the preview button was pressed.  The issue with the blocking
dialog is that, while we can keep the dialog from going away, the way
the code is structured right now we would have to wait until the preview
was done before reattaching to gtk_dialog_run.  This leaves a gap where
the user can hit a button on the dialog and nothing will happen.

There are a couple of solutions as I see them:

1) We could gray out the dialog while the preview is being generated

2) Restructure  _gtk_print_operation_platform_backend_run_dialog so that
we setup the print before we return instead of it happening in the
calling function.

3) Move to a completely async dialog

With 1 we need to figure out a way to reenter
_gtk_print_operation_platform_backend_run_dialog without cleaning up or
reinitializing data. 

With 2 we end up possibly duplicating code across platforms

Is 3 plausible on Windows and Mac?  I sort of like 3 since it simplifies
some things by having 1 API for sync/async in that we could restrict
input to the calling window even if the underlying code is async.

As it is now I can generate a preview by simply having the dialog
dismissed.  I am going to post that patch sometime tomorrow so you can
get a better idea of what I am talking about.
  
-- 
John (J5) Palmieri <johnp redhat com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]