public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Stone, Timothy M" <tstone@ida.org>
To: 'Jon Turney' <jon.turney@dronecode.org.uk>,
	The Cygwin Mailing List <cygwin@cygwin.com>
Subject: RE: [EXT] Re: XWin copy/paste succeeds on Windows 7, crashes on Windows 11 Enterprise.
Date: Mon, 6 Nov 2023 18:33:11 +0000	[thread overview]
Message-ID: <474496f4a2e94e3c8ba06e1a2eaa1d75@ida.org> (raw)
In-Reply-To: <18fd5519-180d-4d48-95d1-994f7c5e36f5@dronecode.org.uk>

[-- Attachment #1: Type: text/plain, Size: 4846 bytes --]



Thanks for your reply.  I didn't provide enough information last time, sorry about that.



Let me start over, with an example and some brief code.



Below is some simple code to bring up a shell with a TextField widget in it.



When I initialize the TextField widget, I change the code to use 1 of the 2 listed translations:



  translations_copypaste:  This translation table calls the built-in actions for paste-clipboard, copy-clipboard, and cut-clipboard when the familiar ctrl-c, ctrl-x, and ctrl-v are pressed.



  translations_ignore:  This translation table always calls ignore_cut_paste() when the same keys are pressed.  This function just prints a message to the console ("Ignoring") so I know it's working.



This is almost the entire program.  All that is missing is initializing the parent and the app_context.





What happens is:



On Windows 7 Professional:

Both translation tables work as expected:

translations_ignore: Correctly causes the text "Ignoring" to print every time ctrl-c, ctrl-x, or ctrl-v are pressed.

translations_copypaste:  Correctly causes text in the small window to cut/paste/copy as expected and is integrated with the system clipboard.



On Windows 11 Enterprise:

translations_ignore: Correctly causes the text "Ignoring" to print every time ctrl-c, ctrl-x, or ctrl-v are pressed.

translations_copypaste:  My application (not the X-Server) crashes every time ctrl-c, ctrl-x, or ctrl-v are pressed.  The X-Server seems to continue running.





I don't know how to debug this further...

  it seems like the translation table is working, since the "ignore" translation table works...

  also, everything works perfectly on Windows 7 professional, so it seems like the "should"" be OK.





Code:




void ignore_cut_paste(Widget widget, XEvent *event, String *args, int *num_args)
{
  printf("Ignoring\n");
}

void TestPaste(Widget parent)
{
  Widget thewin,rowcol,textarea;
  XtActionsRec actions2;

  actions2.string = "ignore_cut_paste";
  actions2.proc = (XtActionProc)ignore_cut_paste;
  XtAppAddActions (app_context, &actions2, 1);

  String translations_copypaste = "#override\n Ctrl<Key>v:  paste-clipboard()\n Ctrl<Key>c:  copy-clipboard()\n Ctrl<Key>x:  cut-clipboard()";

  String translations_ignore = "#override\n Ctrl<Key>v:  ignore_cut_paste()\n Ctrl<Key>c:  ignore_cut_paste()\n Ctrl<Key>x:  ignore_cut_paste()";

  thewin = XtCreatePopupShell("Test", topLevelShellWidgetClass,parent,NULL,0);

  rowcol = XtVaCreateWidget ("rowcol",xmRowColumnWidgetClass, thewin, NULL);

  textarea = XtVaCreateManagedWidget ("test_area",
                                  xmTextFieldWidgetClass, rowcol,
                                  XmNmaxLength,        80,
                                  XmNtranslations,     XtParseTranslationTable ( translations_copypaste ) ,
                                  NULL);
  XtManageChild(textarea);
  XtManageChild (rowcol);
  XtPopup(thewin,XtGrabNone);
}

















-----Original Message-----
From: Jon Turney <jon.turney@dronecode.org.uk>
Sent: Saturday, November 4, 2023 11:11 AM
To: Stone, Timothy M <tstone@ida.org>; The Cygwin Mailing List <cygwin@cygwin.com>
Subject: [EXT] Re: XWin copy/paste succeeds on Windows 7, crashes on Windows 11 Enterprise.



*** This email originated outside of IDA. Please verify that you recognize the sender and know the content is safe before proceeding. ***





On 03/11/2023 20:17, Stone, Timothy M via Cygwin wrote:

>

>

> I'm having a really hard time debugging this issue.

>

>

>

> If I use the exact same version of cygwin and XWin, exact same code, exact same Motif GUI app...

>

>

>

> I find that when I try to use copy/paste functionality in TextFieldWidgets:

>

>

>

>    *Cut/Copy/Paste works perfectly on Windows 7 Professional

>

>

>

>    *Cut/Copy/Paste does not work at all and typically crashes on

> Windows 11 Enterprise

>



I'm assuming this means "the X server crashes", but it's not exactly clear.



If that is the case, there are some instructions on generating backtraces to help with debugging at [1].



[1] https://x.cygwin.com/devel/backtrace.html



>

> I am using an older version of cygwin for this specific test (cygwin 1.7.15 and XWin 1.13.2-1), but I am having the same issue with the latest version as well.

>

[...]

>

> Any help greatly appreciated!  Seems this must be a system issue since everything about the cygwin and XWin is exactly the same on both systems?



It's not really safe to make assumptions like this. This could be a latent bug in XWin which just happens to get exposed on W11 (or that particular system, even)...





  reply	other threads:[~2023-11-06 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 20:17 Stone, Timothy M
2023-11-04 15:10 ` Jon Turney
2023-11-06 18:33   ` Stone, Timothy M [this message]
2023-11-06 18:54     ` [EXT] " Brian Inglis
2023-11-06 19:04       ` Stone, Timothy M
2023-11-06 19:14         ` Brian Inglis
2023-11-06 19:44           ` Stone, Timothy M
2023-11-07 17:20             ` Stone, Timothy M
2023-11-08 15:24               ` Stone, Timothy M
2023-11-16 18:21                 ` Stone, Timothy M

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=474496f4a2e94e3c8ba06e1a2eaa1d75@ida.org \
    --to=tstone@ida.org \
    --cc=cygwin@cygwin.com \
    --cc=jon.turney@dronecode.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).