Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d07019e4
Commit
d07019e4
authored
Feb 29, 2024
by
Gopal Prasad
Committed by
Alexandre Julliard
Apr 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Implement SetWindowText.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56000
Co-authored-by:
Alexandros Frantzis
<
alexandros.frantzis@collabora.com
>
parent
dbc00aec
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletion
+57
-1
wayland_surface.c
dlls/winewayland.drv/wayland_surface.c
+27
-0
waylanddrv.h
dlls/winewayland.drv/waylanddrv.h
+2
-0
waylanddrv_main.c
dlls/winewayland.drv/waylanddrv_main.c
+1
-0
window.c
dlls/winewayland.drv/window.c
+27
-1
No files found.
dlls/winewayland.drv/wayland_surface.c
View file @
d07019e4
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "config.h"
#include "config.h"
#include <assert.h>
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
...
@@ -902,3 +903,29 @@ void wayland_surface_ensure_contents(struct wayland_surface *surface)
...
@@ -902,3 +903,29 @@ void wayland_surface_ensure_contents(struct wayland_surface *surface)
if
(
damage
)
NtGdiDeleteObjectApp
(
damage
);
if
(
damage
)
NtGdiDeleteObjectApp
(
damage
);
}
}
/**********************************************************************
* wayland_surface_set_title
*/
void
wayland_surface_set_title
(
struct
wayland_surface
*
surface
,
LPCWSTR
text
)
{
DWORD
text_len
;
DWORD
utf8_count
;
char
*
utf8
=
NULL
;
assert
(
surface
->
xdg_toplevel
);
TRACE
(
"surface=%p hwnd=%p text='%s'
\n
"
,
surface
,
surface
->
hwnd
,
wine_dbgstr_w
(
text
));
text_len
=
(
lstrlenW
(
text
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
!
RtlUnicodeToUTF8N
(
NULL
,
0
,
&
utf8_count
,
text
,
text_len
)
&&
(
utf8
=
malloc
(
utf8_count
)))
{
RtlUnicodeToUTF8N
(
utf8
,
utf8_count
,
&
utf8_count
,
text
,
text_len
);
xdg_toplevel_set_title
(
surface
->
xdg_toplevel
,
utf8
);
}
free
(
utf8
);
}
dlls/winewayland.drv/waylanddrv.h
View file @
d07019e4
...
@@ -258,6 +258,7 @@ void wayland_surface_coords_to_window(struct wayland_surface *surface,
...
@@ -258,6 +258,7 @@ void wayland_surface_coords_to_window(struct wayland_surface *surface,
struct
wayland_client_surface
*
wayland_surface_get_client
(
struct
wayland_surface
*
surface
);
struct
wayland_client_surface
*
wayland_surface_get_client
(
struct
wayland_surface
*
surface
);
BOOL
wayland_client_surface_release
(
struct
wayland_client_surface
*
client
);
BOOL
wayland_client_surface_release
(
struct
wayland_client_surface
*
client
);
void
wayland_surface_ensure_contents
(
struct
wayland_surface
*
surface
);
void
wayland_surface_ensure_contents
(
struct
wayland_surface
*
surface
);
void
wayland_surface_set_title
(
struct
wayland_surface
*
surface
,
LPCWSTR
title
);
/**********************************************************************
/**********************************************************************
* Wayland SHM buffer
* Wayland SHM buffer
...
@@ -329,6 +330,7 @@ BOOL WAYLAND_ClipCursor(const RECT *clip, BOOL reset);
...
@@ -329,6 +330,7 @@ BOOL WAYLAND_ClipCursor(const RECT *clip, BOOL reset);
LRESULT
WAYLAND_DesktopWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
);
LRESULT
WAYLAND_DesktopWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
);
void
WAYLAND_DestroyWindow
(
HWND
hwnd
);
void
WAYLAND_DestroyWindow
(
HWND
hwnd
);
void
WAYLAND_SetCursor
(
HWND
hwnd
,
HCURSOR
hcursor
);
void
WAYLAND_SetCursor
(
HWND
hwnd
,
HCURSOR
hcursor
);
void
WAYLAND_SetWindowText
(
HWND
hwnd
,
LPCWSTR
text
);
LRESULT
WAYLAND_SysCommand
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
);
LRESULT
WAYLAND_SysCommand
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
);
BOOL
WAYLAND_UpdateDisplayDevices
(
const
struct
gdi_device_manager
*
device_manager
,
BOOL
WAYLAND_UpdateDisplayDevices
(
const
struct
gdi_device_manager
*
device_manager
,
BOOL
force
,
void
*
param
);
BOOL
force
,
void
*
param
);
...
...
dlls/winewayland.drv/waylanddrv_main.c
View file @
d07019e4
...
@@ -41,6 +41,7 @@ static const struct user_driver_funcs waylanddrv_funcs =
...
@@ -41,6 +41,7 @@ static const struct user_driver_funcs waylanddrv_funcs =
.
pKbdLayerDescriptor
=
WAYLAND_KbdLayerDescriptor
,
.
pKbdLayerDescriptor
=
WAYLAND_KbdLayerDescriptor
,
.
pReleaseKbdTables
=
WAYLAND_ReleaseKbdTables
,
.
pReleaseKbdTables
=
WAYLAND_ReleaseKbdTables
,
.
pSetCursor
=
WAYLAND_SetCursor
,
.
pSetCursor
=
WAYLAND_SetCursor
,
.
pSetWindowText
=
WAYLAND_SetWindowText
,
.
pSysCommand
=
WAYLAND_SysCommand
,
.
pSysCommand
=
WAYLAND_SysCommand
,
.
pUpdateDisplayDevices
=
WAYLAND_UpdateDisplayDevices
,
.
pUpdateDisplayDevices
=
WAYLAND_UpdateDisplayDevices
,
.
pWindowMessage
=
WAYLAND_WindowMessage
,
.
pWindowMessage
=
WAYLAND_WindowMessage
,
...
...
dlls/winewayland.drv/window.c
View file @
d07019e4
...
@@ -195,6 +195,7 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
...
@@ -195,6 +195,7 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
HWND
parent
=
NtUserGetAncestor
(
data
->
hwnd
,
GA_PARENT
);
HWND
parent
=
NtUserGetAncestor
(
data
->
hwnd
,
GA_PARENT
);
BOOL
visible
,
xdg_visible
;
BOOL
visible
,
xdg_visible
;
RECT
clip
;
RECT
clip
;
WCHAR
text
[
1024
];
TRACE
(
"hwnd=%p
\n
"
,
data
->
hwnd
);
TRACE
(
"hwnd=%p
\n
"
,
data
->
hwnd
);
...
@@ -223,7 +224,16 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
...
@@ -223,7 +224,16 @@ static void wayland_win_data_update_wayland_surface(struct wayland_win_data *dat
/* If the window is a visible toplevel make it a wayland
/* If the window is a visible toplevel make it a wayland
* xdg_toplevel. Otherwise keep it role-less to avoid polluting the
* xdg_toplevel. Otherwise keep it role-less to avoid polluting the
* compositor with empty xdg_toplevels. */
* compositor with empty xdg_toplevels. */
if
(
visible
)
wayland_surface_make_toplevel
(
surface
);
if
(
visible
)
{
wayland_surface_make_toplevel
(
surface
);
if
(
surface
->
xdg_toplevel
)
{
if
(
!
NtUserInternalGetWindowText
(
data
->
hwnd
,
text
,
ARRAY_SIZE
(
text
)))
text
[
0
]
=
0
;
wayland_surface_set_title
(
surface
,
text
);
}
}
}
}
wayland_win_data_get_config
(
data
,
&
surface
->
window
);
wayland_win_data_get_config
(
data
,
&
surface
->
window
);
...
@@ -669,6 +679,22 @@ static enum xdg_toplevel_resize_edge hittest_to_resize_edge(WPARAM hittest)
...
@@ -669,6 +679,22 @@ static enum xdg_toplevel_resize_edge hittest_to_resize_edge(WPARAM hittest)
}
}
}
}
/*****************************************************************
* WAYLAND_SetWindowText
*/
void
WAYLAND_SetWindowText
(
HWND
hwnd
,
LPCWSTR
text
)
{
struct
wayland_surface
*
surface
=
wayland_surface_lock_hwnd
(
hwnd
);
TRACE
(
"hwnd=%p text=%s
\n
"
,
hwnd
,
wine_dbgstr_w
(
text
));
if
(
surface
)
{
if
(
surface
->
xdg_toplevel
)
wayland_surface_set_title
(
surface
,
text
);
pthread_mutex_unlock
(
&
surface
->
mutex
);
}
}
/***********************************************************************
/***********************************************************************
* WAYLAND_SysCommand
* WAYLAND_SysCommand
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment