mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-31 12:11:56 -07:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0bd541f2fd | ||
|
23d00cdd0d | ||
|
061241d3a2 | ||
|
b9df70be22 | ||
|
9583429eae | ||
|
747c38112b | ||
|
508e82341f | ||
|
ec0a38303b | ||
|
d0bffc4fa9 | ||
|
07a19e2c95 | ||
|
46d5b363fa |
@@ -284,8 +284,10 @@ int requestHyprpaper(std::string arg) {
|
|||||||
void batchRequest(std::string arg, bool json) {
|
void batchRequest(std::string arg, bool json) {
|
||||||
std::string commands = arg.substr(arg.find_first_of(' ') + 1);
|
std::string commands = arg.substr(arg.find_first_of(' ') + 1);
|
||||||
|
|
||||||
if (json)
|
if (json) {
|
||||||
RE2::GlobalReplace(&commands, ";\\s*", ";j/");
|
RE2::GlobalReplace(&commands, ";\\s*", ";j/");
|
||||||
|
commands.insert(0, "j/");
|
||||||
|
}
|
||||||
|
|
||||||
std::string rq = "[[BATCH]]" + commands;
|
std::string rq = "[[BATCH]]" + commands;
|
||||||
request(rq);
|
request(rq);
|
||||||
|
@@ -73,7 +73,7 @@ int main(int argc, char** argv, char** envp) {
|
|||||||
|
|
||||||
if (command.empty()) {
|
if (command.empty()) {
|
||||||
std::println(stderr, "{}", HELP);
|
std::println(stderr, "{}", HELP);
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pPluginManager = std::make_unique<CPluginManager>();
|
g_pPluginManager = std::make_unique<CPluginManager>();
|
||||||
@@ -165,6 +165,7 @@ int main(int argc, char** argv, char** envp) {
|
|||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
} else if (notify && !notifyFail) {
|
} else if (notify && !notifyFail) {
|
||||||
g_pPluginManager->notify(ICON_OK, 0, 4000, "[hyprpm] Loaded plugins");
|
g_pPluginManager->notify(ICON_OK, 0, 4000, "[hyprpm] Loaded plugins");
|
||||||
}
|
}
|
||||||
|
@@ -1097,7 +1097,8 @@ void CCompositor::focusWindow(PHLWINDOW pWindow, SP<CWLSurfaceResource> pSurface
|
|||||||
const auto PWORKSPACE = pWindow->m_pWorkspace;
|
const auto PWORKSPACE = pWindow->m_pWorkspace;
|
||||||
// This is to fix incorrect feedback on the focus history.
|
// This is to fix incorrect feedback on the focus history.
|
||||||
PWORKSPACE->m_pLastFocusedWindow = pWindow;
|
PWORKSPACE->m_pLastFocusedWindow = pWindow;
|
||||||
PWORKSPACE->rememberPrevWorkspace(m_pLastMonitor->activeWorkspace);
|
if (m_pLastMonitor->activeWorkspace)
|
||||||
|
PWORKSPACE->rememberPrevWorkspace(m_pLastMonitor->activeWorkspace);
|
||||||
if (PWORKSPACE->m_bIsSpecialWorkspace)
|
if (PWORKSPACE->m_bIsSpecialWorkspace)
|
||||||
m_pLastMonitor->changeWorkspace(PWORKSPACE, false, true); // if special ws, open on current monitor
|
m_pLastMonitor->changeWorkspace(PWORKSPACE, false, true); // if special ws, open on current monitor
|
||||||
else if (PMONITOR)
|
else if (PMONITOR)
|
||||||
|
@@ -41,8 +41,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
|
|||||||
ruleType = RULE_ANIMATION;
|
ruleType = RULE_ANIMATION;
|
||||||
else if (rule.starts_with("bordercolor"))
|
else if (rule.starts_with("bordercolor"))
|
||||||
ruleType = RULE_BORDERCOLOR;
|
ruleType = RULE_BORDERCOLOR;
|
||||||
else if (rule.starts_with("bordersize"))
|
|
||||||
ruleType = RULE_BORDERSIZE;
|
|
||||||
else if (rule.starts_with("center"))
|
else if (rule.starts_with("center"))
|
||||||
ruleType = RULE_CENTER;
|
ruleType = RULE_CENTER;
|
||||||
else if (rule.starts_with("fullscreenstate"))
|
else if (rule.starts_with("fullscreenstate"))
|
||||||
@@ -65,12 +63,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
|
|||||||
ruleType = RULE_PLUGIN;
|
ruleType = RULE_PLUGIN;
|
||||||
else if (rule.starts_with("pseudo"))
|
else if (rule.starts_with("pseudo"))
|
||||||
ruleType = RULE_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"))
|
else if (rule.starts_with("size"))
|
||||||
ruleType = RULE_SIZE;
|
ruleType = RULE_SIZE;
|
||||||
else if (rule.starts_with("suppressevent"))
|
else if (rule.starts_with("suppressevent"))
|
||||||
@@ -79,8 +71,6 @@ CWindowRule::CWindowRule(const std::string& rule, const std::string& value, bool
|
|||||||
ruleType = RULE_TAG;
|
ruleType = RULE_TAG;
|
||||||
else if (rule.starts_with("workspace"))
|
else if (rule.starts_with("workspace"))
|
||||||
ruleType = RULE_WORKSPACE;
|
ruleType = RULE_WORKSPACE;
|
||||||
else if (rule.starts_with("xray"))
|
|
||||||
ruleType = RULE_XRAY;
|
|
||||||
else if (rule.starts_with("prop"))
|
else if (rule.starts_with("prop"))
|
||||||
ruleType = RULE_PROP;
|
ruleType = RULE_PROP;
|
||||||
else {
|
else {
|
||||||
|
@@ -19,7 +19,6 @@ class CWindowRule {
|
|||||||
RULE_RENDERUNFOCUSED,
|
RULE_RENDERUNFOCUSED,
|
||||||
RULE_ANIMATION,
|
RULE_ANIMATION,
|
||||||
RULE_BORDERCOLOR,
|
RULE_BORDERCOLOR,
|
||||||
RULE_BORDERSIZE,
|
|
||||||
RULE_CENTER,
|
RULE_CENTER,
|
||||||
RULE_FULLSCREENSTATE,
|
RULE_FULLSCREENSTATE,
|
||||||
RULE_GROUP,
|
RULE_GROUP,
|
||||||
@@ -31,14 +30,10 @@ class CWindowRule {
|
|||||||
RULE_OPACITY,
|
RULE_OPACITY,
|
||||||
RULE_PLUGIN,
|
RULE_PLUGIN,
|
||||||
RULE_PSEUDO,
|
RULE_PSEUDO,
|
||||||
RULE_ROUNDING,
|
|
||||||
RULE_SCROLLMOUSE,
|
|
||||||
RULE_SCROLLTOUCHPAD,
|
|
||||||
RULE_SIZE,
|
RULE_SIZE,
|
||||||
RULE_SUPPRESSEVENT,
|
RULE_SUPPRESSEVENT,
|
||||||
RULE_TAG,
|
RULE_TAG,
|
||||||
RULE_WORKSPACE,
|
RULE_WORKSPACE,
|
||||||
RULE_XRAY,
|
|
||||||
RULE_PROP,
|
RULE_PROP,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -20,9 +20,6 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
|
|||||||
|
|
||||||
pWindow->m_vPseudoSize = pWindow->m_vLastFloatingSize;
|
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);
|
bool autoGrouped = IHyprLayout::onWindowCreatedAutoGroup(pWindow);
|
||||||
if (autoGrouped)
|
if (autoGrouped)
|
||||||
return;
|
return;
|
||||||
@@ -31,6 +28,9 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
|
|||||||
onWindowCreatedFloating(pWindow);
|
onWindowCreatedFloating(pWindow);
|
||||||
else
|
else
|
||||||
onWindowCreatedTiling(pWindow, direction);
|
onWindowCreatedTiling(pWindow, direction);
|
||||||
|
|
||||||
|
if (!g_pXWaylandManager->shouldBeFloated(pWindow)) // do not apply group rules to child windows
|
||||||
|
pWindow->applyGroupRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IHyprLayout::onWindowRemoved(PHLWINDOW pWindow) {
|
void IHyprLayout::onWindowRemoved(PHLWINDOW pWindow) {
|
||||||
|
@@ -47,7 +47,7 @@ void CHyprXWaylandManager::activateSurface(SP<CWLSurfaceResource> pSurface, bool
|
|||||||
}
|
}
|
||||||
PWINDOW->m_pXWaylandSurface->activate(activate);
|
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);
|
PWINDOW->m_pXDGSurface->toplevel->setActive(activate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,10 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE
|
||||||
|
extern "C" char** environ;
|
||||||
|
|
||||||
|
//
|
||||||
char const* sigGetenv(char const* name) {
|
char const* sigGetenv(char const* name) {
|
||||||
const size_t len = strlen(name);
|
const size_t len = strlen(name);
|
||||||
for (char** var = environ; *var != nullptr; var++) {
|
for (char** var = environ; *var != nullptr; var++) {
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
#include "Dnd.hpp"
|
#include "Dnd.hpp"
|
||||||
|
#ifndef NO_XWAYLAND
|
||||||
#include "XWM.hpp"
|
#include "XWM.hpp"
|
||||||
#include "XWayland.hpp"
|
#include "XWayland.hpp"
|
||||||
#include "Server.hpp"
|
#include "Server.hpp"
|
||||||
|
#endif
|
||||||
#include "../managers/XWaylandManager.hpp"
|
#include "../managers/XWaylandManager.hpp"
|
||||||
#include "../desktop/WLSurface.hpp"
|
#include "../desktop/WLSurface.hpp"
|
||||||
|
|
||||||
|
#ifndef NO_XWAYLAND
|
||||||
static xcb_atom_t dndActionToAtom(uint32_t actions) {
|
static xcb_atom_t dndActionToAtom(uint32_t actions) {
|
||||||
if (actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY)
|
if (actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY)
|
||||||
return HYPRATOMS["XdndActionCopy"];
|
return HYPRATOMS["XdndActionCopy"];
|
||||||
@@ -15,6 +18,7 @@ static xcb_atom_t dndActionToAtom(uint32_t actions) {
|
|||||||
|
|
||||||
return XCB_ATOM_NONE;
|
return XCB_ATOM_NONE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
eDataSourceType CX11DataOffer::type() {
|
eDataSourceType CX11DataOffer::type() {
|
||||||
return DATA_SOURCE_TYPE_X11;
|
return DATA_SOURCE_TYPE_X11;
|
||||||
|
@@ -633,7 +633,14 @@ void CXWM::handleSelectionRequest(xcb_selection_request_event_t* e) {
|
|||||||
|
|
||||||
if (e->target == HYPRATOMS["TARGETS"]) {
|
if (e->target == HYPRATOMS["TARGETS"]) {
|
||||||
// send mime types
|
// 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;
|
std::vector<xcb_atom_t> atoms;
|
||||||
atoms.push_back(HYPRATOMS["TIMESTAMP"]);
|
atoms.push_back(HYPRATOMS["TIMESTAMP"]);
|
||||||
|
Reference in New Issue
Block a user