Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Linux下,打印功能不可用,程序崩溃 #317

Open
L-Super opened this issue Sep 15, 2023 · 4 comments
Open

[BUG]: Linux下,打印功能不可用,程序崩溃 #317

L-Super opened this issue Sep 15, 2023 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed Linux Problems on Linux triage

Comments

@L-Super
Copy link
Member

L-Super commented Sep 15, 2023

Describe the bug 【Bug描述】

在Linux平台下运行QCefViewTest程序,右键选择打印,程序崩溃,报错信息:

[0915/161844.284269:ERROR:print_dialog_linux.cc(156)] Null interface in CreatePrintDialog; printing will fail.
[0915/161844.284334:ERROR:device_event_log_impl.cc(222)] [16:18:44.284] Printer: print_error_dialog.cc:61 所选打印机无法使用或未正确安装。请检查打印机,或尝试选择其他打印机。
[0915/161844.286439:FATAL:message_box_dialog.cc(231)] Check failed: !is_system_modal. 

直接使用js的window.print(),或者开发者工具里调用window.print()均会导致程序崩溃。

另外,测试cefclient、cefsimple,NCW,OSR模式下均可以正常调用打印对话框,不会崩溃。

To Reproduce 【复现步骤】

  1. 调用打印功能
  2. 崩溃

Expected behavior 【正确的预期行为】

调用系统打印对话框

Screenshots 【截图】

...

Environment 【BUG产生的环境】

  • OSR/NCW Mode: all
  • OS & Version: Linux
  • Qt Version: 5.15.2
  • CEF Version: 113.3.5+g0b33855+chromium-113.0.5672.129

Additional context 【更多额外信息】

测试平台:UOS、Ubuntu 22.04.3 LTS

@L-Super L-Super added bug Something isn't working triage feature New feature labels Sep 15, 2023
@L-Super L-Super added help wanted Extra attention is needed Linux Problems on Linux and removed feature New feature labels Sep 15, 2023
@oufengfang
Copy link

我也碰到这个问题,有初步的怀疑原因吗?

@L-Super
Copy link
Member Author

L-Super commented May 11, 2024

我也碰到这个问题,有初步的怀疑原因吗?

当时怀疑是没有实现打印功能

@oufengfang
Copy link

是没实现,实现这个接口就好了:///
/// Implement this interface to handle printing on Linux. Each browser will have
/// only one print job in progress at a time. The methods of this class will be
/// called on the browser process UI thread.
///
/--cef(source=client)--/
class CefPrintHandler : public virtual CefBaseRefCounted {

@L-Super
Copy link
Member Author

L-Super commented May 20, 2024

是没实现,实现这个接口就好了:/// /// Implement this interface to handle printing on Linux. Each browser will have /// only one print job in progress at a time. The methods of this class will be /// called on the browser process UI thread. /// /--cef(source=client)--/ class CefPrintHandler : public virtual CefBaseRefCounted {

如果可以的话,欢迎提交PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Linux Problems on Linux triage
Projects
None yet
Development

No branches or pull requests

3 participants