Skip to content

Commit

Permalink
Refactoring of qt_server.cc.
Browse files Browse the repository at this point in the history
* Removed AA_EnableHighDpiScaling since it is already always on.

```
renderer/qt/qt_server.cc:110:34: warning: 'Qt::AA_EnableHighDpiScaling' is deprecated: High-DPI scaling is always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
  110 |   QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~
```

#codehealth

PiperOrigin-RevId: 603732370
  • Loading branch information
hiroyuki-komatsu committed Feb 2, 2024
1 parent 44fa3c1 commit e806731
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/renderer/qt/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ mozc_cc_qt_library(
"//config:config_handler",
"//ipc:named_event",
"//protocol:renderer_cc_proto",
"@com_google_absl//absl/flags:flag",
],
)

Expand Down
12 changes: 4 additions & 8 deletions src/renderer/qt/qt_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
#include <QApplication>
#include <QMetaType>
#include <algorithm>
#include <memory>
#include <cstdint>
#include <string>
#include <utility>

#include "absl/flags/flag.h"
#include "base/logging.h"
#include "base/system_util.h"
#include "base/vlog.h"
#include "client/client_interface.h"
#include "config/config_handler.h"
#include "ipc/named_event.h"
#include "protocol/renderer_command.pb.h"
#include "renderer/qt/qt_ipc_thread.h"

// By default, mozc_renderer quits when user-input continues to be
// idle for 10min.
Expand Down Expand Up @@ -75,7 +75,7 @@ QtServer::QtServer()
: timeout_(0) {
if (absl::GetFlag(FLAGS_restricted)) {
absl::SetFlag(&FLAGS_timeout,
// set 60sec with restricted mode
// set 60 sec with restricted mode
std::min(absl::GetFlag(FLAGS_timeout), 60));
}

Expand Down Expand Up @@ -106,10 +106,6 @@ void QtServer::Update(std::string command) {
}

int QtServer::StartServer(int argc, char **argv) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif // QT_VERSION

// |QWidget::move()| never works with wayland platform backend. Always use
// 'xcb' platform backend. https://github.com/google/mozc/issues/794
::setenv("QT_QPA_PLATFORM", "xcb", 1);
Expand Down

0 comments on commit e806731

Please sign in to comment.