{
}
-int DSWaylandInputMethodPrivate::getResourceId(Resource *resource)
+int DSWaylandInputMethodPrivate::getResourceId(DSWaylandInputMethodContextPrivate::Resource *resource)
{
int id = -1;
- std::multimap<Resource*, int>::iterator it;
+ std::multimap<DSWaylandInputMethodContextPrivate::Resource*, int>::iterator it;
for (it = __contextMap.begin(); it != __contextMap.end(); it++)
{
if (resource == (*it).first)
return id;
}
-DSWaylandServer::wl_input_method::Resource* DSWaylandInputMethodPrivate::getResource(int id)
+DSWaylandInputMethodContextPrivate::Resource* DSWaylandInputMethodPrivate::getResource(int id)
{
- Resource *resource = nullptr;
+ DSWaylandInputMethodContextPrivate::Resource *resource = nullptr;
- std::multimap<Resource*, int>::iterator it;
+
+ std::multimap<DSWaylandInputMethodContextPrivate::Resource*, int>::iterator it;
for (it = __contextMap.begin(); it != __contextMap.end(); it++)
{
if (id == (*it).second)
void DSWaylandInputMethodPrivate::sendActivate(void *contextResource, int textInputId, bool focusInEvent)
{
- Resource *resource = Resource::fromResource((struct ::wl_resource *)contextResource);
- __contextMap.insert(std::pair<Resource*, int>(resource, textInputId));
+ DSWaylandInputMethodContextPrivate::Resource *resource = DSWaylandInputMethodContextPrivate::Resource::fromResource((struct ::wl_resource *)contextResource);
+ __contextMap.insert(std::pair<DSWaylandInputMethodContextPrivate::Resource*, int>(resource, textInputId));
send_activate(__resource->handle, (struct ::wl_resource *)contextResource, textInputId, focusInEvent);
}
void DSWaylandInputMethodPrivate::sendDeactivate(void *contextResource, bool focusInEvent)
{
- Resource *resource = Resource::fromResource((struct ::wl_resource *)contextResource);
+ DSWaylandInputMethodContextPrivate::Resource *resource = DSWaylandInputMethodContextPrivate::Resource::fromResource((struct ::wl_resource *)contextResource);
__contextMap.erase(resource);
send_deactivate(__resource->handle, (struct ::wl_resource *)contextResource, focusInEvent);
}
-void DSWaylandInputMethodPrivate::showInputPanel(void *contextResource)
+void DSWaylandInputMethodPrivate::showInputPanel(void *contextResource, int textInputId)
{
- send_show_input_panel((struct ::wl_resource *)contextResource);
+ //Resource *resource = getResource(textInputId);
+ send_show_input_panel(__resource->handle, (struct ::wl_resource *)contextResource);
}
-void DSWaylandInputMethodPrivate::hideInputPanel(void *contextResource)
+void DSWaylandInputMethodPrivate::hideInputPanel(void *contextResource, int textInputId)
{
- send_hide_input_panel((struct ::wl_resource *)contextResource);
+ //Resource *resource = getResource(textInputId);
+ send_hide_input_panel(__resource->handle, (struct ::wl_resource *)contextResource);
}
void DSWaylandInputMethodPrivate::input_method_bind_resource(Resource *resource)
DS_GET_PRIV(DSWaylandInputMethod);
if (__activateContext)
- priv->showInputPanel(__activateContext);
+ priv->showInputPanel(__activateContext, textInputId);
}
void DSWaylandInputMethod::hideInputPanel(int textInputId)
{
DS_GET_PRIV(DSWaylandInputMethod);
+ if (textInputId < 0)
+ {
+ textInputId = priv->getResourceId(DSWaylandInputMethodContextPrivate::Resource::fromResource((struct ::wl_resource *)__activateContext));
+ }
+
if (__activateContext)
- priv->hideInputPanel(__activateContext);
+ priv->hideInputPanel(__activateContext, textInputId);
}
void DSWaylandInputMethod::resetTextInput()
if (__activateContext)
{
- priv->hideInputPanel(__activateContext);
+ priv->hideInputPanel(__activateContext, -1);
}
}
namespace display_server
{
+class DSWaylandInputMethodContextPrivate;
+
class DS_DECL_EXPORT DSWaylandInputMethodPrivate : public DSObjectPrivate, public DSWaylandServer::wl_input_method
{
DS_PIMPL_USE_PUBLIC(DSWaylandInputMethod);
void sendActivate(void *contextResource, int textInputId, bool focusInEvent);
void sendDeactivate(void *contextResource, bool focusInEvent);
- void showInputPanel(void *contextResource);
- void hideInputPanel(void *contextResource);
- int getResourceId(Resource *resource);
- Resource* getResource(int id);
+ void showInputPanel(void *contextResource, int textInputId);
+ void hideInputPanel(void *contextResource, int textInputId);
+ int getResourceId(DSWaylandInputMethodContextPrivate::Resource *resource);
+ DSWaylandInputMethodContextPrivate::Resource* getResource(int id);
protected:
void input_method_bind_resource(Resource *resource);
private:
DSWaylandCompositor *__compositor;
Resource *__resource;
- std::multimap<Resource*, int> __contextMap;
+ std::multimap<DSWaylandInputMethodContextPrivate::Resource*, int> __contextMap;
};
}
inputPanelFloating = pub->__inputPanel->getFloatingData();
(void) inputPanelFloating;
+ (void) floatingData;
#if 0//Unreachable code ! Thus, disable temporarily.
if (!floatingData || !inputPanelFloating) return;
{
DS_GET_PUB(DSWaylandTextInputManager);
- pub->createTextInput((void *)(resource->client()));
+ pub->createTextInput((void *)(resource->client()), id);
}
{
}
-void DSWaylandTextInputManager::createTextInput(void *client)
+void DSWaylandTextInputManager::createTextInput(void *client, unsigned int managerId)
{
- __textInput->createGlobal(client, allocTextInputId());
+ __textInput->createGlobal(client, managerId, allocTextInputId());
}
int DSWaylandTextInputManager::allocTextInputId()
{
}
-void DSWaylandTextInputPrivate::createGlobal(void *client, int id)
+void DSWaylandTextInputPrivate::createGlobal(void *client, unsigned int managerId, int id)
{
- Resource *resource = add((struct ::wl_client *)client, 1);
+ Resource *resource = add((struct ::wl_client *)client, managerId, 1);
__resourceIdMap.insert(std::pair<Resource*, int>(resource, id));
}
{
}
-void DSWaylandTextInput::createGlobal(void *client, int id)
+void DSWaylandTextInput::createGlobal(void *client, unsigned int managerId, int id)
{
DS_GET_PRIV(DSWaylandTextInput);
- priv->createGlobal(client, id);
+ priv->createGlobal(client, managerId, id);
}
void DSWaylandTextInput::showInputPanel()
DSWaylandTextInput(DSWaylandCompositor *compositor, DSWaylandTextInputManager *textInputManager, DSTextInputPrivate *dsTextInputPrivate);
~DSWaylandTextInput() override;
- void createGlobal(void *client, int id);
+ void createGlobal(void *client, unsigned int managerId, int id);
void showInputPanel();
void hideInputPanel();
DSWaylandTextInputManager(DSWaylandCompositor *compositor, DSTextInputPrivate *dsTextInputPrivate);
~DSWaylandTextInputManager() override;
- void createTextInput(void *client);
+ void createTextInput(void *client, unsigned int managerId);
int allocTextInputId();
void contextCommitString(unsigned int serial, std::string text);
DSWaylandTextInputPrivate(DSWaylandTextInput *p_ptr, DSWaylandCompositor *compositor);
~DSWaylandTextInputPrivate() override;
- void createGlobal(void *client, int id);
+ void createGlobal(void *client, unsigned int managerId, int id);
int getResourceId(Resource *resource);
void showInputPanel(void *resource);
void hideInputPanel(Resource *resource, bool forceHide);