Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
X11: Don't use a client event as a wrapper for XMoveResizeWindow
Simply configure the window from here
  • Loading branch information
magcius committed Jul 21, 2013
1 parent ca97b10 commit 01ff855
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
6 changes: 4 additions & 2 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -795,8 +795,10 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event)
}
#if defined(HAVE_X11) && HAVE_X11
wxRect client_rect = m_RenderParent->GetClientRect();
X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()),
"RESIZE", client_rect.x, client_rect.y, client_rect.width, client_rect.height);
XMoveResizeWindow(X11Utils::XDisplayFromHandle(GetHandle()),
X11Utils::XWindowFromHandle(GetHandle()),
client_rect.x, client_rect.y,
client_rect.width, client_rect.height);
#endif
m_LogWindow->Refresh();
m_LogWindow->Update();
Expand Down
5 changes: 0 additions & 5 deletions Source/Core/DolphinWX/Src/GLInterface/X11_Util.cpp
Expand Up @@ -313,11 +313,6 @@ void cX11Window::XEventThread()
if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", False))
Host_Message(WM_USER_STOP);
if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.evdpy, "RESIZE", False))
XMoveResizeWindow(GLWin.evdpy, GLWin.win,
event.xclient.data.l[1], event.xclient.data.l[2],
event.xclient.data.l[3], event.xclient.data.l[4]);
break;
default:
break;
Expand Down
20 changes: 0 additions & 20 deletions Source/Core/DolphinWX/Src/X11Utils.cpp
Expand Up @@ -32,26 +32,6 @@ extern char **environ;
namespace X11Utils
{

void SendClientEvent(Display *dpy, const char *message,
int data1, int data2, int data3, int data4)
{
XEvent event;
Window win = (Window)Core::GetWindowHandle();

// Init X event structure for client message
event.xclient.type = ClientMessage;
event.xclient.format = 32;
event.xclient.data.l[0] = XInternAtom(dpy, message, False);
event.xclient.data.l[1] = data1;
event.xclient.data.l[2] = data2;
event.xclient.data.l[3] = data3;
event.xclient.data.l[4] = data4;

// Send the event
if (!XSendEvent(dpy, win, False, False, &event))
ERROR_LOG(VIDEO, "Failed to send message %s to the emulator window.", message);
}

void SendKeyEvent(Display *dpy, int key)
{
XEvent event;
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/Src/X11Utils.h
Expand Up @@ -43,8 +43,6 @@
namespace X11Utils
{

void SendClientEvent(Display *dpy, const char *message,
int data1, int data2, int data3, int data4);
void SendKeyEvent(Display *dpy, int key);
void SendButtonEvent(Display *dpy, int button, int x, int y, bool pressed);
void SendMotionEvent(Display *dpy, int x, int y);
Expand Down

0 comments on commit 01ff855

Please sign in to comment.