mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 22:18:55 +02:00
* to start: eval 'dbus-launch —auto-syntax' ; /system/apps/PCManFM * crashes on exit * TODO: add icon for PCManFM
158 lines
4.5 KiB
Plaintext
158 lines
4.5 KiB
Plaintext
From 8cc806e9244b74c82c88c15b379d2188ea7872ec Mon Sep 17 00:00:00 2001
|
|
From: Sergei Reznikov <diver@gelios.net>
|
|
Date: Tue, 22 May 2018 18:33:27 +0300
|
|
Subject: Fix build on Haiku
|
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 5110cb1..24dfb04 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -17,7 +17,9 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|
find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED)
|
|
find_package(Qt5DBus ${QT_MINIMUM_VERSION} REQUIRED)
|
|
find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
|
|
-find_package(Qt5X11Extras ${QT_MINIMUM_VERSION} REQUIRED)
|
|
+if (UNIX AND NOT HAIKU)
|
|
+ find_package(Qt5X11Extras "${REQUIRED_QT_VERSION}" REQUIRED)
|
|
+endif()
|
|
find_package(fm-qt ${LIBFMQT_MINIMUM_VERSION} REQUIRED)
|
|
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
diff --git a/pcmanfm/CMakeLists.txt b/pcmanfm/CMakeLists.txt
|
|
index 09a9eea..21e8c0c 100644
|
|
--- a/pcmanfm/CMakeLists.txt
|
|
+++ b/pcmanfm/CMakeLists.txt
|
|
@@ -80,13 +80,20 @@ target_include_directories(pcmanfm-qt
|
|
"${Qt5Gui_PRIVATE_INCLUDE_DIRS}"
|
|
)
|
|
|
|
+if(UNIX AND NOT HAIKU)
|
|
+target_link_libraries(pcmanfm-qt Qt5::X11Extras)
|
|
+endif()
|
|
+
|
|
target_link_libraries(pcmanfm-qt
|
|
- Qt5::X11Extras
|
|
Qt5::Widgets
|
|
Qt5::DBus
|
|
fm-qt
|
|
)
|
|
|
|
+if(HAIKU)
|
|
+ target_link_libraries(pcmanfm-qt network)
|
|
+endif ()
|
|
+
|
|
install(TARGETS pcmanfm-qt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
# install a desktop entry file for pcmanfm-qt and desktop preferences
|
|
diff --git a/pcmanfm/application.cpp b/pcmanfm/application.cpp
|
|
index 41acbf5..872d252 100644
|
|
--- a/pcmanfm/application.cpp
|
|
+++ b/pcmanfm/application.cpp
|
|
@@ -51,9 +51,9 @@
|
|
#include "launcher.h"
|
|
#include "xdgdir.h"
|
|
#include "connectserverdialog.h"
|
|
-
|
|
-#include <X11/Xlib.h>
|
|
-
|
|
+#ifndef Q_OS_HAIKU
|
|
+ #include <X11/Xlib.h>
|
|
+#endif
|
|
|
|
namespace PCManFM {
|
|
|
|
@@ -364,6 +364,9 @@ void Application::onAboutToQuit() {
|
|
}
|
|
|
|
bool Application::eventFilter(QObject* watched, QEvent* event) {
|
|
+#ifdef Q_OS_HAIKU
|
|
+ return 0;
|
|
+#elif
|
|
if(watched == desktop()) {
|
|
if(event->type() == QEvent::StyleChange ||
|
|
event->type() == QEvent::ThemeChange) {
|
|
@@ -371,6 +374,7 @@ bool Application::eventFilter(QObject* watched, QEvent* event) {
|
|
}
|
|
}
|
|
return QObject::eventFilter(watched, event);
|
|
+#endif
|
|
}
|
|
|
|
void Application::onLastWindowClosed() {
|
|
diff --git a/pcmanfm/desktopwindow.cpp b/pcmanfm/desktopwindow.cpp
|
|
index abe9061..24ab729 100644
|
|
--- a/pcmanfm/desktopwindow.cpp
|
|
+++ b/pcmanfm/desktopwindow.cpp
|
|
@@ -54,10 +54,13 @@
|
|
#include "xdgdir.h"
|
|
#include "bulkrename.h"
|
|
|
|
-#include <QX11Info>
|
|
+#ifndef Q_OS_HAIKU
|
|
+ #include <QX11Info>
|
|
+ #include <X11/Xlib.h>
|
|
+#endif
|
|
+
|
|
#include <QScreen>
|
|
#include <xcb/xcb.h>
|
|
-#include <X11/Xlib.h>
|
|
|
|
#define MIN_SLIDE_INTERVAL 5*60000 // 5 min
|
|
#define MAX_SLIDE_INTERVAL (24*60+55)*60000 // 24 h and 55 min
|
|
@@ -1119,6 +1122,7 @@ void DesktopWindow::onFilePropertiesActivated() {
|
|
}
|
|
}
|
|
|
|
+#ifndef Q_OS_HAIKU
|
|
static void forwardMouseEventToRoot(QMouseEvent* event) {
|
|
xcb_ungrab_pointer(QX11Info::connection(), event->timestamp());
|
|
// forward the event to the root window
|
|
@@ -1184,8 +1188,12 @@ static void forwardMouseEventToRoot(QMouseEvent* event) {
|
|
xcb_send_event(QX11Info::connection(), 0, root, mask, (char*)&xcb_event);
|
|
xcb_flush(QX11Info::connection());
|
|
}
|
|
+#endif
|
|
|
|
bool DesktopWindow::event(QEvent* event) {
|
|
+#ifdef Q_OS_HAIKU
|
|
+ return 0;
|
|
+#elif
|
|
switch(event->type()) {
|
|
case QEvent::WinIdChange: {
|
|
//qDebug() << "winid change:" << effectiveWinId();
|
|
@@ -1203,7 +1211,9 @@ bool DesktopWindow::event(QEvent* event) {
|
|
xcb_change_property(con, XCB_PROP_MODE_REPLACE, effectiveWinId(), prop_atom, XA_ATOM, 32, 1, &atom);
|
|
}
|
|
break;
|
|
+#endif
|
|
}
|
|
+#ifndef Q_OS_HAIKU
|
|
#undef FontChange // FontChange is defined in the headers of XLib and clashes with Qt, let's undefine it.
|
|
case QEvent::StyleChange:
|
|
case QEvent::FontChange:
|
|
@@ -1218,8 +1228,12 @@ bool DesktopWindow::event(QEvent* event) {
|
|
}
|
|
|
|
#undef FontChange // this seems to be defined in Xlib headers as a macro, undef it!
|
|
+#endif
|
|
|
|
bool DesktopWindow::eventFilter(QObject* watched, QEvent* event) {
|
|
+#ifdef Q_OS_HAIKU
|
|
+ return 0;
|
|
+#elif
|
|
if(watched == listView_) {
|
|
switch(event->type()) {
|
|
case QEvent::StyleChange:
|
|
@@ -1252,6 +1266,7 @@ bool DesktopWindow::eventFilter(QObject* watched, QEvent* event) {
|
|
}
|
|
}
|
|
return Fm::FolderView::eventFilter(watched, event);
|
|
+#endif
|
|
}
|
|
|
|
void DesktopWindow::childDropEvent(QDropEvent* e) {
|
|
--
|
|
2.16.2
|
|
|