Skip to content

Commit

Permalink
Minor fixes (#315)
Browse files Browse the repository at this point in the history
* Minor fixes

* Fix #77
  • Loading branch information
Eeems authored Jul 2, 2023
1 parent e687472 commit fd4b65c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions applications/system-service/buttonhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void ButtonHandler::run(){
emit keyUp(map[ie.code].keyCode);
}
}else{
qApp->processEvents(QEventLoop::AllEvents, 100);
yieldCurrentThread();
}
}
Expand Down
3 changes: 2 additions & 1 deletion applications/system-service/digitizerhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class DigitizerHandler : public QThread {
qDebug() << "Reading From : " << device.device.c_str() << " (" << name << ")";
qDebug() << "Listening for events...";
while(handle_events()){
yieldCurrentThread();
qApp->processEvents(QEventLoop::AllEvents, 100);
QThread::yieldCurrentThread();
}
}
bool handle_events(){
Expand Down
5 changes: 3 additions & 2 deletions applications/system-service/fifohandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ class FifoHandler : public QObject {
QString line(data.c_str());
line = line.trimmed();
emit dataRecieved(this, line);
thread()->yieldCurrentThread();
qApp->processEvents(QEventLoop::AllEvents, 100);
QThread::yieldCurrentThread();
}
if(in.eof()){
in.clear();
}
thread()->yieldCurrentThread();
QThread::yieldCurrentThread();
}

private:
Expand Down
7 changes: 7 additions & 0 deletions applications/system-service/wifiapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ class WifiAPI : public APIBase {
if(m_state == Off){
setState(Disconnected);
}
if(system("rfkill unblock wifi")){
qDebug() << "Failed to enable wifi devices";
return false;
}
for(auto wlan : wlans){
if(!wlan->isUp() && !wlan->up()){
qDebug() << "Failed to enable " + wlan->iface();
Expand Down Expand Up @@ -265,6 +269,9 @@ class WifiAPI : public APIBase {
qDebug() << "Failed to disable " + wlan->iface();
}
}
if(system("rfkill block wifi")){
qDebug() << "Failed to disable wifi devices";
}
flushBSSCache(0);
xochitlSettings.set_wifion(false);
}
Expand Down
5 changes: 5 additions & 0 deletions shared/liboxide/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* \brief Log a debug message if compiled with DEBUG mode, and debugging is enabled
* \param msg Debug message to log
*/
#ifndef DEBUG
#ifndef QT_NO_DEBUG
#define DEBUG
#endif
#endif
#ifdef DEBUG
#define O_DEBUG(msg) if(Oxide::debugEnabled()){ qDebug() << msg; }
#else
Expand Down

0 comments on commit fd4b65c

Please sign in to comment.