Skip to content

Commit

Permalink
Remove fret, optimize suspend/resume, move button handling to qml
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Feb 3, 2024
1 parent 463d159 commit 6a2c301
Show file tree
Hide file tree
Showing 20 changed files with 198 additions and 631 deletions.
2 changes: 0 additions & 2 deletions applications/applications.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ SUBDIRS = \
lockscreen \
notify-send \
process-manager \
screenshot-tool \
screenshot-viewer \
settings-manager \
system-service \
Expand All @@ -29,7 +28,6 @@ launcher.depends = system-service update-desktop-database
lockscreen.depends = system-service
notify-send.depends = system-service
process-manager.depends =
screenshot-tool.depends = system-service
screenshot-viewer.depends = system-service
settings-manager.depends = system-service
system-service.depends =
Expand Down
7 changes: 5 additions & 2 deletions applications/display-server/dbusinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@
#include <QDBusUnixFileDescriptor>
#include <QCoreApplication>
#include <QQmlComponent>
#include <QFileInfo>
#include <sys/poll.h>
#include <unistd.h>
#include <QDBusMetaType>
#include <liboxide/debug.h>
#include <liboxide/epaper.h>
#include <liboxide/devicesettings.h>
#include <libblight/types.h>
#include <libblight/socket.h>
#include <cstring>

DbusInterface::DbusInterface(QObject* parent)
: QObject(parent),
m_focused(nullptr)
m_focused(nullptr),
buttonsDevNumber{QFileInfo(deviceSettings.getButtonsDevicePath()).baseName().midRef(5).toInt()}
{
engine.load(QUrl(QStringLiteral("qrc:/Workspace.qml")));
if(engine.rootObjects().isEmpty()){
Expand Down Expand Up @@ -369,7 +372,7 @@ void DbusInterface::serviceOwnerChanged(const QString& name, const QString& oldO
}

void DbusInterface::inputEvents(unsigned int device, const std::vector<input_event>& events){
if(m_focused != nullptr){
if(m_focused != nullptr && device != buttonsDevNumber){
m_focused->inputEvents(device, events);
}
for(auto connection : qAsConst(connections)){
Expand Down
1 change: 1 addition & 0 deletions applications/display-server/dbusinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private slots:
QByteArray selection;
QByteArray secondary;
} clipboards;
unsigned int buttonsDevNumber;

Connection* getConnection(QDBusMessage message);
Connection* getConnection(QString identifier);
Expand Down
10 changes: 5 additions & 5 deletions applications/display-server/evdevhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ EvDevHandler* EvDevHandler::init(){
}

EvDevHandler::EvDevHandler()
: QThread()
: QThread(),
enabled{true}
{
setObjectName("EvDevHandler");
reloadDevices();
Expand All @@ -46,13 +47,12 @@ bool EvDevHandler::hasDevice(event_device device){
void EvDevHandler::reloadDevices(){
O_DEBUG("Reloading devices");
for(auto& device : deviceSettings.inputDevices()){
if(device.device == deviceSettings.getButtonsDevicePath()){
continue;
}
if(!hasDevice(device) && device.fd > 0){
auto input = new EvDevDevice(this, device);
connect(input, &EvDevDevice::inputEvents, this, [this, input](auto events){
dbusInterface->inputEvents(input->number(), events);
if(enabled){
dbusInterface->inputEvents(input->number(), events);
}
}, Qt::QueuedConnection);
O_DEBUG(input->name() << "added");
devices.append(input);
Expand Down
3 changes: 0 additions & 3 deletions applications/display-server/evdevhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class EvDevHandler : public QThread{
EvDevHandler();
~EvDevHandler();

signals:
void inputEvents(unsigned int device, const std::vector<input_event>& events);

private:
QList<EvDevDevice*> devices;
bool hasDevice(event_device device);
Expand Down
73 changes: 0 additions & 73 deletions applications/screenshot-tool/.gitignore

This file was deleted.

108 changes: 0 additions & 108 deletions applications/screenshot-tool/main.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions applications/screenshot-tool/screenshot-tool.pro

This file was deleted.

1 change: 0 additions & 1 deletion applications/system-service/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "systemapi.h"
#include "notificationapi.h"
#include "screenapi.h"
#include "buttonhandler.h"
#include "apibase.h"

using namespace Oxide::Applications;
Expand Down
Loading

0 comments on commit 6a2c301

Please sign in to comment.