Compare commits

...

11 Commits

Author SHA1 Message Date
Vaxry
0bd541f2fd version: bump to 0.46.2 2024-12-19 19:26:47 +00:00
Aqa-Ib
23d00cdd0d layout: apply group rules after window creation (#8779)
* apply group rules after window creation

* clang-format
2024-12-19 19:26:40 +00:00
Vaxry
061241d3a2 core: fix possible crash on null active workspace
fixes #7822
2024-12-19 19:26:40 +00:00
Aaron Blasko
b9df70be22 hyprpm: fix hyrpm sometimes returning 0 despite errors occuring (#8761)
* hyprpm: fix hyrpm sometimes returning 0 despite errors occuring

* there u go
2024-12-19 19:26:40 +00:00
Jan Beich
9583429eae core: Unbreak build on FreeBSD (#8762)
* CrashReporter: restore explicit environ(7) after 8bbeee1173

BSD systems don't declare environ(7) in any header like POSIX suggests.

src/signal-safe.cpp:12:23: error: use of undeclared identifier 'environ'
   12 |     for (char** var = environ; *var != nullptr; var++) {
      |                       ^

* fix

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
2024-12-19 19:26:40 +00:00
Vaxry
747c38112b xwayland: fix compile with no xwayland 2024-12-19 19:26:40 +00:00
Vaxry
508e82341f xwm: fixup targets in selection requests
fixes #8719
2024-12-19 19:26:40 +00:00
Vaxry
ec0a38303b xwayland: fix dnd including xwayland
ref #8759
2024-12-19 19:26:40 +00:00
Vaxry
d0bffc4fa9 core: avoid activating toplevel-less surfaces
ref #8609
2024-12-19 19:26:40 +00:00
Khalid
07a19e2c95 hyprctl: Fix hyprctl batch JSON command (#8749) 2024-12-19 19:26:40 +00:00
Vaxry
46d5b363fa windowrules: fixup duplicate rule enum tags
fixes #8746
2024-12-19 19:26:40 +00:00
11 changed files with 28 additions and 24 deletions

View File

@@ -1 +1 @@
0.46.0
0.46.2

View File

@@ -284,8 +284,10 @@ int requestHyprpaper(std::string arg) {
void batchRequest(std::string arg, bool json) {
std::string commands = arg.substr(arg.find_first_of(' ') + 1);
if (json)
if (json) {
RE2::GlobalReplace(&commands, ";\\s*", ";j/");
commands.insert(0, "j/");
}
std::string rq = "[[BATCH]]" + commands;
request(rq);

View File

@@ -73,7 +73,7 @@ int main(int argc, char** argv, char** envp) {
if (command.empty()) {
std::println(stderr, "{}", HELP);
return 0;
return 1;
}
g_pPluginManager = std::make_unique<CPluginManager>();
@@ -165,6 +165,7 @@ int main(int argc, char** argv, char** envp) {
break;
default: break;
}
return 1;
} else if (notify && !notifyFail) {
g_pPluginManager->notify(ICON_OK, 0, 4000, "[hyprpm] Loaded plugins");
}

View File

@@ -1097,7 +1097,8 @@ void CCompositor::focusWindow(PHLWINDOW pWindow, SP<CWLSurfaceResource> pSurface
const auto PWORKSPACE = pWindow->m_pWorkspace;
// This is to fix incorrect feedback on the focus history.
PWORKSPACE->m_pLastFocusedWindow = pWindow;
PWORKSPACE->rememberPrevWorkspace(m_pLastMonitor->activeWorkspace);
if (m_pLastMonitor->activeWorkspace)
PWORKSPACE->rememberPrevWorkspace(m_pLastMonitor->activeWorkspace);
if (PWORKSPACE->m_bIsSpecialWorkspace)
m_pLastMonitor->changeWorkspace(PWORKSPACE, false, true); // if special ws, open on current monitor
else if (PMONITOR)

View File

@@ -41,8 +41,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
ruleType = RULE_ANIMATION;
else if (rule.starts_with("bordercolor"))
ruleType = RULE_BORDERCOLOR;
else if (rule.starts_with("bordersize"))
ruleType = RULE_BORDERSIZE;
else if (rule.starts_with("center"))
ruleType = RULE_CENTER;
else if (rule.starts_with("fullscreenstate"))
@@ -65,12 +63,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
ruleType = RULE_PLUGIN;
else if (rule.starts_with("pseudo"))
ruleType = RULE_PSEUDO;
else if (rule.starts_with("rounding"))
ruleType = RULE_ROUNDING;
else if (rule.starts_with("scrollmouse"))
ruleType = RULE_SCROLLMOUSE;
else if (rule.starts_with("scrolltouchpad"))
ruleType = RULE_SCROLLTOUCHPAD;
else if (rule.starts_with("size"))
ruleType = RULE_SIZE;
else if (rule.starts_with("suppressevent"))
@@ -79,8 +71,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
ruleType = RULE_TAG;
else if (rule.starts_with("workspace"))
ruleType = RULE_WORKSPACE;
else if (rule.starts_with("xray"))
ruleType = RULE_XRAY;
else if (rule.starts_with("prop"))
ruleType = RULE_PROP;
else {

View File

@@ -19,7 +19,6 @@ class CWindowRule {
RULE_RENDERUNFOCUSED,
RULE_ANIMATION,
RULE_BORDERCOLOR,
RULE_BORDERSIZE,
RULE_CENTER,
RULE_FULLSCREENSTATE,
RULE_GROUP,
@@ -31,14 +30,10 @@ class CWindowRule {
RULE_OPACITY,
RULE_PLUGIN,
RULE_PSEUDO,
RULE_ROUNDING,
RULE_SCROLLMOUSE,
RULE_SCROLLTOUCHPAD,
RULE_SIZE,
RULE_SUPPRESSEVENT,
RULE_TAG,
RULE_WORKSPACE,
RULE_XRAY,
RULE_PROP,
};

View File

@@ -20,9 +20,6 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
pWindow->m_vPseudoSize = pWindow->m_vLastFloatingSize;
if (!g_pXWaylandManager->shouldBeFloated(pWindow)) // do not apply group rules to child windows
pWindow->applyGroupRules();
bool autoGrouped = IHyprLayout::onWindowCreatedAutoGroup(pWindow);
if (autoGrouped)
return;
@@ -31,6 +28,9 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
onWindowCreatedFloating(pWindow);
else
onWindowCreatedTiling(pWindow, direction);
if (!g_pXWaylandManager->shouldBeFloated(pWindow)) // do not apply group rules to child windows
pWindow->applyGroupRules();
}
void IHyprLayout::onWindowRemoved(PHLWINDOW pWindow) {

View File

@@ -47,7 +47,7 @@ void CHyprXWaylandManager::activateSurface(SP<CWLSurfaceResource> pSurface, bool
}
PWINDOW->m_pXWaylandSurface->activate(activate);
}
} else if (PWINDOW->m_pXDGSurface)
} else if (PWINDOW->m_pXDGSurface && PWINDOW->m_pXDGSurface->toplevel)
PWINDOW->m_pXDGSurface->toplevel->setActive(activate);
}

View File

@@ -7,6 +7,10 @@
#include <unistd.h>
#include <cstring>
// NOLINTNEXTLINE
extern "C" char** environ;
//
char const* sigGetenv(char const* name) {
const size_t len = strlen(name);
for (char** var = environ; *var != nullptr; var++) {

View File

@@ -1,10 +1,13 @@
#include "Dnd.hpp"
#ifndef NO_XWAYLAND
#include "XWM.hpp"
#include "XWayland.hpp"
#include "Server.hpp"
#endif
#include "../managers/XWaylandManager.hpp"
#include "../desktop/WLSurface.hpp"
#ifndef NO_XWAYLAND
static xcb_atom_t dndActionToAtom(uint32_t actions) {
if (actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY)
return HYPRATOMS["XdndActionCopy"];
@@ -15,6 +18,7 @@ static xcb_atom_t dndActionToAtom(uint32_t actions) {
return XCB_ATOM_NONE;
}
#endif
eDataSourceType CX11DataOffer::type() {
return DATA_SOURCE_TYPE_X11;

View File

@@ -633,7 +633,14 @@ void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) {
if (e->target == HYPRATOMS["TARGETS"]) {
// send mime types
auto mimes = g_pSeatManager->selection.currentSelection->mimes();
std::vector<std::string> mimes;
if (sel == &clipboard && g_pSeatManager->selection.currentSelection)
mimes = g_pSeatManager->selection.currentSelection->mimes();
else if (sel == &dndSelection && !dndDataOffers.empty() && dndDataOffers.at(0)->source)
mimes = dndDataOffers.at(0)->source->mimes();
if (mimes.empty())
Debug::log(WARN, "[xwm] WARNING: No mimes in TARGETS?");
std::vector<xcb_atom_t> atoms;
atoms.push_back(HYPRATOMS["TIMESTAMP"]);