__committedW(0),
__committedH(0),
__created(false),
- __visible(false),
__hasFocus(false),
__waylandSurface(nullptr),
__winShell(nullptr),
- __firstCommit(true),
- __changedGeometry(false),
__acceptsFocus(true),
__allowUserGeometry(false),
__title(""),
return __winShell;
}
-void DSWindowPrivate::sendConfigure(void)
-{
- if (__winShell)
- {
- __winShell->sendConfigure();
- }
-}
-
bool DSWindowPrivate::setVkbdFloating(bool set)
{
__vkbd_floating = set;
{
DS_GET_PUB(DSWindow);
- if (__firstCommit)
- {
- DSLOG_DBG("DSWindow", "First Commit!!! ");
- __firstCommit = false;
- }
-
- if (__changedGeometry)
- {
- DSLOG_DBG("DSWindow", "Geometry Changed!!! Send Configure... geo(%d,%d,%d,%d) commit(%d,%d)", __x, __y, __w, __h, __committedW, __committedH);
- sendConfigure();
- __changedGeometry = false;
- }
-
if (waylandSurfaceCommitInfo->bufferChanged()) {
std::shared_ptr<IDSBuffer> buffer = waylandSurfaceCommitInfo->getBuffer();
- if (buffer)
- {
- std::shared_ptr<stSize> bufferSize = buffer->getSize();
- __committedW = bufferSize->w;
- __committedH = bufferSize->h;
-
- if (!__visible)
- __visible = true;
- }
- else
- {
- __visible = false;
- }
// emit a signal of the buffer changed
pub->__bufferChangedSignal.emit(buffer);
priv->__x = x;
priv->__y = y;
- priv->__changedGeometry = true;
-
__windowPositionChangedSignal.emit(nullptr);
}
priv->__w = w;
priv->__h = h;
-
- priv->__changedGeometry = true;
}
void DSWindow::setSize(stSize size)
priv->__w = size.w;
priv->__h = size.h;
-
- priv->__changedGeometry = true;
}
void DSWindow::setZOrder(unsigned int zOrder)
bool setWindowShell(DSWindowShell *winShell);
DSWindowShell *getWindowShell(void);
- void sendConfigure(void);
-
bool setVkbdFloating(bool set);
bool getVkbdFloating();
unsigned int __zOrder;
unsigned int __committedW, __committedH;
bool __created;
- bool __visible;
bool __hasFocus;
std::shared_ptr<DSWaylandSurface> __waylandSurface;
DSWindowShell *__winShell;
- bool __firstCommit;
- bool __changedGeometry;
bool __acceptsFocus;
bool __allowUserGeometry;
std::string __title;
__reqX(0), __reqY(0),
__reqW(0), __reqH(0),
__parent(nullptr),
- __layer(0)
+ __layer(0),
+ __firstCommit(true),
+ __changedGeometry(false),
+ __visible(false)
{
+ __window->registerCallbackBufferChanged(this, std::bind(&DSWindowShellPrivate::__onWindowBufferChanged, this, std::placeholders::_1));
}
DSWindowShellPrivate::~DSWindowShellPrivate()
__x = __y = __w = __h = 0;
__window->setPosition(__x, __y);
__window->setSize(__w, __h);
+ __changedGeometry = true;
}
else
{
__window->setPosition(__x, __y);
__window->setSize(__w, __h);
+ __changedGeometry = true;
}
}
{
__window->setPosition(__x, __y);
__window->setSize(__w, __h);
+ __changedGeometry = true;
}
return true;
__window->setPosition(__x, __y);
__window->setSize(__w, __h);
+ __changedGeometry = true;
}
}
else
__x = x;
__y = y;
__window->setPosition(__x, __y);
+ __changedGeometry = true;
}
}
else
__h = h;
__window->setPosition(__x, __y);
__window->setSize(__w, __h);
+ __changedGeometry = true;
}
}
else
}
}
+void DSWindowShellPrivate::__onWindowBufferChanged(std::shared_ptr<IDSBuffer> buffer)
+{
+ if (__firstCommit)
+ {
+ DSLOG_DBG("DSWindow", "First Commit!!! ");
+ __firstCommit = false;
+ }
+
+ if (__changedGeometry)
+ {
+ std::shared_ptr<stSize> bufferSize = buffer->getSize();
+ DSLOG_DBG("DSWindow", "Geometry Changed!!! Send Configure... geo(%d,%d,%d,%d) commit(%d,%d)", __x, __y, __w, __h, bufferSize->w, bufferSize->h);
+ sendConfigure();
+ __changedGeometry = false;
+ }
+
+ if (buffer) {
+ __visible = true;
+ } else {
+ __visible = false;
+ }
+
+}
+
} // namespace display_server
bool deleted;
};
-class DSWindowShellPrivate
+class DSWindowShellPrivate : public DSObject
{
DS_PIMPL_USE_PUBLIC(DSWindowShell)
bool __create(int x, int y, unsigned int w, unsigned int h, DSWindowShell *pWin, DSWindowShell *pParent);
bool __findInChildList(DSWindowShell *parentWinShell);
bool __setParent(DSWindowShell *parentWinShell);
+ void __onWindowBufferChanged(std::shared_ptr<IDSBuffer> buffer);
struct stWindowAuxHint* __findAuxHint(int32_t id);
void __handleAuxHint(stWindowAuxHint *hint);
unsigned int __reqW, __reqH; // requested size by client
DSWindowShell *__parent;
int __layer;
+ bool __firstCommit;
+ bool __changedGeometry;
+ bool __visible;
std::list<DSWindowShell*> __childList;
std::list<stWindowAuxHint*> __auxHintsList;
};